Oct 17, 2005 #1 sheila11 Programmer Dec 27, 2000 251 US Hi all, I need to create an element, with a name that is read from a variable. I tried: <xsl:element name="$vName"> <!-- some stuff here --> <xsl:element> but it doesn't work. What's the correct way ? TIA, Sheila
Hi all, I need to create an element, with a name that is read from a variable. I tried: <xsl:element name="$vName"> <!-- some stuff here --> <xsl:element> but it doesn't work. What's the correct way ? TIA, Sheila
Oct 17, 2005 Thread starter #2 sheila11 Programmer Dec 27, 2000 251 US Ok, I found the solution: <xsl:element name="{$vName}"> I guess that {} forces the evaluation of the variable. But don't know why I don't need {} everywhere. Sheila Upvote 0 Downvote
Ok, I found the solution: <xsl:element name="{$vName}"> I guess that {} forces the evaluation of the variable. But don't know why I don't need {} everywhere. Sheila
Oct 18, 2005 #3 JontyMC Programmer Nov 26, 2001 1,276 GB {} tells the processor that inside those brackets is an XPath expression. In this case a variable. Curly brackets are very useful. Jon "I don't regret this, but I both rue and lament it. Upvote 0 Downvote
{} tells the processor that inside those brackets is an XPath expression. In this case a variable. Curly brackets are very useful. Jon "I don't regret this, but I both rue and lament it.