Creating tags with non-literal data in XSLT

If you’re forced to work with a schema where the tag names contain derived data (node position in this case) you can create your tag names in XSL using the element tag:

<xsl:element name="{concat('mytagname', position( ))}"> <xsl:value-of select="mytag"/></xsl:element>

Posted on 03 Dec 04 by Helen Emerson (last updated on 03 Dec 04).
Filed under Web development