[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: are there non streaming use cases of fn:snapshot

Subject: Re: are there non streaming use cases of fn:snapshot function
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2019 06:30:50 -0000
Re:  are there non streaming use cases of fn:snapshot
Am 15.03.2019 um 07:07 schrieb Mukul Gandhi gandhi.mukul@xxxxxxxxx:
Hi all,
B B I've read the XSLT 3.0 spec forB fn:snapshot function. As stated in the spec, this function has lots of uses while using streaming, which is great.




I'm curious to know, what could be good non streaming use cases of fn:snapshot function ?


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

<xsl:for-each select="//foo!snapshot()">

B <xsl:result-document href="foo{position()}.xml">

B B B B <xsl:copy-of select="/"/>

B </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. It is not that hard with the help of tunnel parameters but using snapshot for sure results in more compact code.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.