Re: XSLT V 1.1

Subject: Re: XSLT V 1.1
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sun, 15 Oct 2000 18:54:11 +0100
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


Current Thread