|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using a variable for node name matching
> In the stylesheet below, can "$startnode" be used for node matching,
> instead of having to type in the whole string ( TEST/TEST1/TEST2 )
> everytime ?
>
> <xsl:variable name="startnode">
> <xsl:text>TEST/TEST1/TEST2</xsl:text>
> </xsl:variable>
Not really. You can go some way towards this by storing a node-set in a
variable and using that as the initial element of a path, but it doesn't
quite have the effect you are looking for.
So, you could say:
<xsl:variable name="startnode" select="test/test1/test2"/>
<xsl:for-each select="$startnode/some/other/nodes">
...
</xsl:for-each>
but the variable mechanism is not as flexible as what you are asking
about. I wish it were.
Steve
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








