Re: XSLT V 1.1

Subject: Re: XSLT V 1.1
From: Paul Tchistopolskii <paul@xxxxxxx>
Date: Fri, 15 Sep 2000 09:42:55 -0700
From: David Carlisle <davidc@xxxxxxxxx>

> > I don't understand what you're saying. Could you please 
> > provide an XSL code or pseuodocode to explain why 
> > I need something other than top-level URI ?
> 
> suppose the source file has
> 
> <mumble href="xxx.xml"/>
> 
> and I want the stylesheet to use document() to follow that link then
> I need
> 
> <xsl:template match="mumble">
>  <xsl:apply-templates select="document(@href,????)"/>
> </xsl:template>
> 
> Currently ???? is . so I get the URI of the current mumble node as the
> base URI with which to resolve the relative URI ref.
> 
> You haven't suggested any way so far in which to get this functionality
> with your proposed replacement.

<xsl:template match="mumble">
 <xsl:apply-templates select="document(@href, 'subdir' )"/>
</xsl:template>

Maybe I don't understand you ?
 
> Except for little example files as posted to this list, in real
> documents around here, the base URI of the mumble node is _almost never_
> the base URI of the root of the input document. Chapters sections etc
> almost always live in subdirectories of the directory containing the
> root node.

So what's a problem? If you don't like to write 

<mumble href="some/xxx.xml"/>

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

You can write:

<mumble href="xxx.xml"/>

<xsl:template match="mumble">
<xsl:apply-templates select="document(@href, 'some')"/>
</xsl:template>

What's the problem ?

> If you were looking to change things, I think i t 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(.)))"

I'm fine with your solution or with *any* other solution which will 
turn document() monster into something simpler. 

Current document mixes  3 semantics.

Rgds.Paul.



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


Current Thread