Re: Spurious error on recursive invocation of fn:transform

Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]> Tue, 24 Nov 2020 12:28:44 +0000
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
> 
> But note that RFC 3986 does *explicitly* license the “same document
> reference” in section 4.4:
> 
>  When a same-document reference is dereferenced for a retrieval action,
>  the target of that reference is defined to be within the same entity
>  (representation, document, or message) as the reference; therefore, a
>  dereference should not result in a new retrieval action.
> 
> It isn’t a dreadful hack that someone has discovered just happens to
> work, it’s a dreadful hack predicated on an aspect of web architecture
> that seemed reasonably easy to support in 1.0 and which is not easy to
> support in 3.0.
> 
>   

The problem here is that an entity doesn't equate to a stylesheet.

I'd also forgotten the rule about "should not result in a new retrieval action". In theory that means we have to keep the stylesheet around, as an XML document, at run-time just in case it tries to read itself. What Saxon actually does is to read it again. That's partly because saving memory was useful once-upon-a-time; it's also because the whitespace-stripping rules (also comments and PIs) for stylesheets and source documents are different: there's no way we can put whitespace and comments back once they're gone, and there's no way we want to hang on to them just in case they are needed.

Michael Kay
Saxonica

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help