I am trying to produce html output according to the fields in xml file with xslt. And I name them according to grandparent-parent-child-grandchild relation in xml
For instance:
<root>
<node1>
<node2>
<node3>Data</node3>
</node2>
</node1>
What i need is creating let's say textbox, with name node1__node2__node3
What i did so far is this
<input type="text" name="node1__
node2__
node3__"
But what i want to is:
<input type="text" name="node1__node2__node3__"/>
So it is useless. My xslt to produce this useless output is:
<xsl:template name="chooseNameID">
<xsl:param name="currentNode"/><!-- in this case currentNode is node3 -->
<xsl:variable name="fieldNames">
<xsl:for-each select="$currentNode/ancestor::*">
<xsl:value-of select="name(.)"/>__
</xsl:for-each>
</xsl:variable>
<xsl:attribute name="name">
<xsl:value-of select="$fieldNames"/>
</xsl:attribute>
</xsl:template>
I guess the problem is in <xsl:value-of
but i cannot find any solution to that.
Thanks