Re: [xsl] are there non streaming use cases of fn:snapshot function

Subject: Re: [xsl] are there non streaming use cases of fn:snapshot function
From: "Mukul Gandhi gandhi.mukul@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2019 07:41:38 -0000
Thanks, Martin for insightful comments.

On Fri, Mar 15, 2019 at 12:00 PM Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Well, whether you have streaming or not supported, snapshot makes
> splitting up files where you want to preserve the tree structure easy


Ok.

It does seem that, among other things fn:snapshot preserves nodes along the
ancestor axis, but it doesn't preserve nodes along preceding-sibling axis.
I think, that makes fn:snapshot more useful.


> e.g.
>
> <xsl:for-each select="//foo!snapshot()">
>
>    <xsl:result-document href="foo{position()}.xml">
>
>       <xsl:copy-of select="/"/>
>
>    </xsl:result-document>
>
> </xsl:for-each>
>
> Without snapshot in XSLT 2 you would need to write templates to
> reconstruct the ancestor tree of the foo elements.


Thanks for example above. Its useful.




-- 
Regards,
Mukul Gandhi

Current Thread