Re: doc() and docref() relative to source document

Subject: Re: doc() and docref() relative to source document
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 16 Jun 1999 10:14:28 +0700
docref() resolves relative URIs to the source document. For example, if
you have a source document http://www.jclark.com/foo.xml containing

 <doc href="bar.xml"/>

and a stylesheet http://www.jclark.com/stylesheets/style.xsl, then
instantiating a template

<xsl:template match="doc">
  <xsl:apply-templates select="docref(@href)"/>
</xsl:template>

will process the file  http://www.jclark.com/bar.xml not the file
http://www.jclark.com/stylesheets/bar.xml.

Nick Manson wrote:
> 
> After reading the latest working draft, I have a question
> about doc() and docref().
> 
> According to my understanding of the spec, the URI reference
> is mapped relative the stylesheet.  How do you reference
> documents relative to the source document?
> 
> As near as I can tell, (I haven't had time to play with the
> latest xt yet) there isn't even a standard way to get the
> element base-URI.  So, I can't even think of a generic way
> of extending an XSL processor to retrieve relative URLs in
> the source document.
> 
> Am I missing something?



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread