-
- Downloads
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.
Loading
Please register or sign in to comment