Skip to content
Snippets Groups Projects
Commit d1754fd82de6 authored by Jason Viers's avatar Jason Viers
Browse files

document('') fails to return stylesheets parsed from memory

If an XSL stylesheet is from memory (e.g. xmlParseMemory), then xpath
expressions referencing "document('')" will never return a match.

When getting down into it, I understand the logic "document() is resolved
relative to the XSL's location, reading from memory has no location, therefore
buzz off", but the XSL spec seems to address this:

http://www.w3.org/TR/xslt#document
"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."

The fact that the behavior differs in this case between fromFile & fromMemory
definitely caught me off guard, and IMHO fixing that scenario is worth the
one-off-ness of the fix.
parent bde334fbd773
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment