[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
pseuodocode
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.