[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: node-set = node-set involving variable fails
Roger Glover <glover_roger@xxxxxxxxx> wrote: > I discovered the "nodeset()" extension function in Xalan, so now my joy is > complete, even though my XSLT Recommendation compliance is not. You can have your cake and eat it too by replacing xsl:variable with some regular elements: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://myURI.foo.com" exclude-result-prefixes="foo" version="1.0"> <foo:var name="targets"> <target>target1</target> <target>target2</target> <!-- ...... --> <target>target93</target> </foo:var> <xsl:variable name="targets" select="document('')/*/foo:var[@name = 'targets']"/> <xsl:template match="/"> <out> <xsl:for-each select="$targets/*"> <xsl:text>
</xsl:text> <target> <xsl:value-of select="."/> </target> </xsl:for-each> <xsl:text>
</xsl:text> </out> </xsl:template> </xsl:stylesheet> The xsl:for-each is there just to demonstrate that the variable is really a node-set. Not tested, but you get the idea! ;-) Dave 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
|