Re: [xsl] Member function?

Subject: Re: [xsl] Member function?
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 2 Aug 2022 15:12:07 -0000
A contra view?

On Tue, 2 Aug 2022 at 16:04, Michael Kay mike@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I would also comment that you need to wean yourself off using document('') to read data held in the stylesheet.
>
> Firstly, it only works if the source code of the stylesheet is available at run-time, and if its base URI is known. There are all sorts of operational circumstances where that might not be true.

In my usage it has been reliable, though I agree for others it will not be.


>
> Secondly, it's ludicrously expensive: because the whitespace rules for document() and different from the rules for stylesheets, it means the stylesheet has to be reparsed and another copy of the tree kept in memory.

Tree built in 2.211666ms  - no problem for my usage Mike?


>
> It's a workaround for the silly result-tree-fragment problem in XSLT 1.0 and needs to be consigned to the dustbin of history. Use a global variable instead.
>


OK, I'll ask. xsl:variable name=x select= ??  if not document('')


RTF solved a problem (in 1998?). I guess there was less experience
around at the time?

regards





-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.

Current Thread