Re: document('') in a SEF stylesheet
Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]>
| Newsgroups | gmane.text.xml.saxon.help |
|---|---|
| Message-ID | <[email protected]> |
document("") loads whatever is found at the stylesheet base URI.
When executing from a SEF file, the base URI depends on whether the compilation specified relocatable="yes". With relocatable="yes", the base URI will be the deployed location of the SEF file. With relocatable="no", it will be the original location of the source stylesheet (which may well not be accessible from the deployed location).
This isn't actually a conformance issue: using document("") to load the source stylesheet has only ever worked if the source stylesheet is available at run-time, and there's nothing in the language spec that says this should be the case. It's just something that was generally true with the first generation of interpretive XSLT processors.
Usually document("") is used as a workaround for the result-tree-fragment problem in XSLT 1.0, and the right solution is to access data using a global variable and not using the document() function.
Michael Kay
Saxonica
> On 26 Aug 2020, at 14:27, Martynas Jusevičius <martynas-tyFqBaoSXPC1Z/[email protected]> wrote:
>
> Hi,
>
> Am I right that the document('') call would load the SEF JSON file and
> return an FODC0002 "Misplaced or malformed XML file"?
>
> I was looking under Conformance in the documentation but couldn't find
> this covered.
>
> Are there any workarounds, besides supplying the URI of the original
> .xsl file into document()?
>
>
> Martynas
>
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help