[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
RE: looping through Elements stored in a variable..
Subject: RE: looping through Elements stored in a variable..|
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 19 Nov 2002 10:52:38 -0500
Has the option of two passes (separate transforms) been mentioned yet in
It's sometimes easy to forget that multiple passes can be achieved by
making, um, multiple passes. :-> (In this case the first pass would be a
simple routine to make the university list available in the source tree:
Of course, Mike is also correct that the node-set casting function can't be
done without to process result node-sets, as are others who pointed out
that in this case, the information in the variable may also be served up in
(or as) an internal lookup table, so there's also another workaround.
But lately I've been learning how there are actually some advantages for
maintenance to splitting up a transform into separate passes, even when you
don't need the node-set() extension. (Not that this is one of them.)
At 04:23 AM 11/19/2002, you wrote:
If it were possible to do this in XSLT 1.0 without using the
xx:node-set() extension, then the xx:node-set() extension would not have
been invented. You're out of luck, I'm afraid. Unless of course you use
an XSLT 1.1 or XSLT 2.0 processor.
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Laura Jenkins
> Sent: 18 November 2002 17:12
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: looping through Elements stored in a variable..
> Hello people,
> i have the following xsl structure
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> <xsl:template match="/">
> <xsl:variable name="univ-var">
> <University id = "1"> University1</University>
> <University id = "2"> University2</University>
> <University id = "3"> University3</University>
> <University id = "4"> University4</University>
> </University-List >
> <!-- i want to iterate through this variable without usiing
> the extension nodeset..-->
> <!-- something along the lines of .. -->
> <xsl:for-each select="$place-var/placements/placement">
> <xsl:value-of select="."/>
> What i was doing obviousl;y does not work because it needs to
> be a nodeset. Can any one tell me how to do this without
> using the extension : nodeset. Its is MANDATORY that I DO
> NOT USE the extension nodeset. Thanks
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau
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