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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--