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

RE: Using document()

Subject: RE: Using document()
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 9 Oct 2002 10:55:00 -0400
RE:  Using document()
[ Adam van den Hoven]
 
> I want to use the following:
>  
> <xsl:apply-templates select="document('#id2')" /> 
>  
> Ok, I'd never actually use this. In reality its something like:
>  
> <xsl:apply-templates select="document(@xlink:href)" />
>  
> which is likely to contain simply fragment identifiers since 
> I'm using XLinks to normalize a sitemap hierarchy. 
>  
> When I try to run this as part of a transform, I get an error 
> saying that the file (fully resolved to refer to the source 
> doc) cannot be found. Is this a problem with how I'm doing 
> things or perhaps a problem with app I'm using to develop 
> templates with (Stylus Studio)?

You are asking to retrieve a document whose url is "#id2".  This is a
relative url.  The base of relative urls is normally the stylesheet
itself, which is probably not what you want here.  What did you want to
retrieve?  If you expected to retrieve an element from the XML source
document whose id is "id2", you can get it, for example, with
//*[@id='id2'] (which would work even in the absence of a DTD that
declares the id attribute to be of type ID), or perhaps by other more
efficient expressions depending on what you know about the source
document.

Cheers,

Tom P

 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.