xsl-list
[Top] [All Lists]

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

2019-03-15 02:42:04
Thanks, Martin for insightful comments.

On Fri, Mar 15, 2019 at 12:00 PM Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>