Reputation: 5544
I have defined a variable $myVar (meaning that the following xsl):
<xsl:value-of select="$myVar"/>
gives as output:
NiceStr
I want to create a tag:
<NiceStr/>
in a sense I would write something of this kind:
<<xsl:value-of select="$myVar">/>
which, obviously, doesn't work.
How to name a tag with a name dependent on the input xml?
Upvotes: 0
Views: 28
Reputation: 52878
Try:
<xsl:element name="{$myVar}"/>
The {}
is an attribute value template so the $myVar
gets evaluated.
Upvotes: 4