Hi Guys,
I have been trying to re-factor some existing xslt code and wonder if it is possible to select nodes based on a string.
The string is built up by parameters so the value of the target node is determined each time the xsl template is called. I am having trouble using the string to select the target node. In the sample below I can calculate the name of the target node I am after, but I am unsure how to convert the name into an actual node.
<xsl:template name="createOptionList"> <xsl:param name="parentNode" select="string()" /> <xsl:param name="childNode" select="string()" />
<xsl:variable name="targetNode" select="concat(name($listNode),'/',$listItem)" />
<xsl:for-each select="$targetNode" > ... do the processing .... </xsl:for-each>
Any advice, greatly appreciated.
Adam,
I'm not too sure what you're trying to do. Are you trying to create an element named with the value of $targetNode? Or are you trying to apply your templates to the nodes named in the value of $targetNode?
If all you're trying to do is create a new named $targetNode, all you'd have to do is:
<xsl:element name="$targetNode"">foo</xsl:element>
So, again, I'm not to sure what you're trying to accomplish.. perhaps an xslt list can help.
Tony
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
