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

RE: is document('') mandatory for xslt1-conformant pro

Subject: RE: is document('') mandatory for xslt1-conformant processor?
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 7 Jan 2002 16:18:29 -0000
xslt1 document
> As I understand xslt1 spec is somewhat ambiguous about document('')
> feature. Firstly it says: "An XSLT processor is not required
> to support
> any particular URI schemas". But some paragraphs below it
> says: "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;...".
> So, is document('') mandatory or not?

"" is a relative URI, it does not use any URI scheme. (A URI scheme is
denoted by the part of the URI before the ":", e.g. the http scheme starts
"http:".) I think an XSLT 1.0 processor is obliged to support the document()
function with relative URIs.

One thing you do need to beware of: document("") actually selects the XML
entity whose URI is the same as the base URI of the stylesheet element
containing the call on document(""). If the stylesheet contains multiple XML
entities, this may not be whole stylesheet module. If the stylesheet is
embedded, this XML entity may contain more than the stylesheet module. If
the stylesheet uses xml:base to change the base URI, you may get something
completely different back. And the stylesheet module, of course, is not
necessarily the whole stylesheet.

> I care about it particularly because I involved in developing a
> specialized xslt processor, which compiles stylesheets to some
> intermediate code and so have trouble to get source of xsl stylesheet.

I think that document("") is allowed to fail if the user executing the
transformation does not have read permission to the source stylesheet. The
rule says that document("") is a reference to the source stylesheet, it
doesn't say that the user running the stylesheet has to have permissions to
access the source stylesheet, and like any other call on document(), it
should fail if the user doesn't have the necessary permissions.

Mike Kay


 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.