|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: ordering and iteration problem
Mark:
At 06:44 PM 5/1/01, you wrote: I'm curious why one typically initializes "random-nodes" from the stylesheet document rather than the input document. It seems to me that the input document is guaranteed to have enough nodes, while the XSLT transform document might not if the input document is big enough. No reason. One could speculate about how this technique tends to be a 'pull' technique, and that in 'pull' applications stylesheets tend to be largish (XSLT verboseness) but source documents, smallish, whereas the reverse might be the case in a 'push' application. But really, that'd be pushing it: maybe we're just showing off how we know how to use document(''). The only thing to be careful about is to make sure you have *enough* nodes, which is why this iteration workaround (which of course fails without any warning if your node set falls short) is kind of scuzzy compared to a proper solution using recursion. But as long as you're going to do it, declaring a global variable like yours (I'm assuming you're declaring $random-nodes at the top level, since you don't want to call '//node()' every time you hit a template) is a fine way to go; using a $plenty-of-nodes variable that's already been declared for some other purpose is even better. (Jeni, what's your perspective?) Regards, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== 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








