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

Re: Getting the path to the stylesheet [RETRY]

Subject: Re: Getting the path to the stylesheet [RETRY]
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 06 Jul 2012 12:12:18 +0100
Re:  Getting the path to the stylesheet [RETRY]
On 06/07/2012 11:37, Chris Maloney wrote:
Why do we need the xsl:for-each on the document('').
This sets the context to be the root node of the stylesheet, so then the
unparsed-entity-uri() function acts based on that context.  From the spec:

The unparsed-entity-uri returns the URI of the unparsed entity with the
specified name in the same document as the context node
This is very clever! Thanks for sharing it, Ken!



Yes, indeed, it's a very neat idea.


One drawback is that I don't think you can rely on all XSLT processors getting it right:

(a) In the XSLT 1.0 spec it's not unambiguously clear that unparsed-entity-uri() is expected to return the absolute URI, and I believe there are processors that return the system ID as it appears in the source

(b) XML parsers aren't always very good at reporting information about unparsed entities. For example in Saxon-CE we generally can't get this information from the native XML parser in the browser, and so unparsed-entity-uri() generally doesn't work.

Michael Kay
Saxonica

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.