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

Re: XALAN does not handle document('') as expected to

Subject: Re: XALAN does not handle document('') as expected to carry out an in-stylesheet look-up
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 1 Nov 2001 16:35:38 -0500
Re:  XALAN does not handle document('') as expected to
[<David_N_Bertoni@xxxxxxxxx>]
>
>
> Working as designed.  I suspect that most processors work this way, since
> stylesheets are processed with the goal of building an efficient run-time
> mechanism for performing the transformation described by the stylesheet.
> Also, there are different rules for interpreting stylesheet xml files and
> source documents.  From the recommendation:
>
>    "When the first argument to the document function is not a node-set,
the
>    first argument is converted to a string as if by a call to the string
>    function. This string is treated as a URI reference; the resource
>    identified by the URI is retrieved. The data resulting from the
>    retrieval action is parsed as an XML document and a tree is constructed
>    in accordance with the data model (see [3 Data Model])."
>
> and
>
>    "Note that a zero-length URI reference is a reference to the document
>    relative to which the URI reference is being resolved; thus
document("")
>    refers to the root node of the stylesheet; the tree representation of
>    the stylesheet is exactly the same as if the XML document containing
the
>    stylesheet was the initial source document."
>
> Of course, a processor _could_ detect references to the stylesheet by
> looking for any calls to the document() function, but it would be
> impossible to detect all cases, so I don't see how this would work.
>
> You might think about using an EntityResolver to solve this problem.  I'd
> recommend you post a question on the Xalan mailing list for more
> information.
>

Seems to me that this is very clear - document('') should give you the root
of the stylesheet, which is what Mark wanted.  Instead, it seems that Xalan
is trying to get a document at the base url of the xml document.  This would
give the same result if it had in fact been in the same directory as the
stylesheet, but here there never was a physical xml document.

Sounds like a bug to me.

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.