Re: XSLT V 1.1
David Carlisle wrote: >If you were looking to change things, I think it would be simpler to use >a one-argument form of document() along with two functions, as follows > >select="document(uri-resolve-with-base(@href,uri-of-node(.)))" > >where uri-resolve-with-base() takes two strings and makes an absolute >URI (essentially by removing anything after the last / in the base, >concatenating that with the relative URI and then cleaning up ../ and ./ >segments, or just returning the first argument if it is already absolute) > >and uri-of-node() returns the URI of the first node in its node-set >argument. This solution wouldn't handle situations where there are multiple documents being accessed through the same document() call: <class-files> <file href="class1.xml" /> <file href="class2.xml" /> <file href="class3.xml" /> </class-files> <xsl:for-each select="document(class-files/file/@href)/classes/class"> <xsl:sort select="@name" /> ... </xsl:for-each> If document() accepted only single strings (or nodes), sorting a collection of classes drawn from several files would, I think (?), only be possible by going through an intermediary result tree fragment. Cheers, Jeni Jeni Tennison http://www.jenitennison.com/ 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