[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] doc paths


Subject: RE: [xsl] doc paths
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 20 Nov 2004 08:48:53 -0000

You could either (a) use the document function rather than doc - document()
resolves URIs relative the base URI of the node that they come from, in the
case where they come from a node, or (b) resolve the URI yourself using the
resolve-uri() function in XPath 2.0.

document($nodes) is more-or-less equivalent to

for each $n in $nodes return
  doc(resolve-uri(string($n), base-uri($n)))

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Bruce D'Arcus [mailto:bdarcus@xxxxxxxxxxxxx] 
> Sent: 20 November 2004 03:34
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] doc paths
> 
> I decided to try to implement my idea to use XSLT 2.o temporary trees 
> to resolve xincludes, but am stuck on how to deal with the paths 
> properly.  How do I modify the below to look for the path relative to 
> the document, rather than the stylesheets?
> 
>    <xsl:template match="xi:include" mode="resolve-linked-docs">
>      <xsl:copy-of select="doc(@href)" />
>    </xsl:template>
> 
> Bruce


Current Thread
Keywords