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

Re: streaming XSLT creating a header from a first reco

Subject: Re: streaming XSLT creating a header from a first record
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 8 May 2018 18:11:02 -0000
Re:  streaming XSLT creating a header from a first reco
On 08.05.2018 18:04, Michael Kay mike@xxxxxxxxxxxx wrote:
I don't think you need two accumulators, you can have a single accumulator that matches every row and only creates the map if the current value is an empty map.

Taking up that idea I tried also to construct a streaming accumulator that stores a (shallow) copy of the first row element and a deep copy of its attributes:


<xsl:accumulator name="first-row-copy" as="element(row)?" initial-value="()" streamable="yes">
<xsl:accumulator-rule match="table/row">
<xsl:choose>
<xsl:when test="empty($value)">
<xsl:copy>
<xsl:copy-of select="@*"/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:accumulator-rule>
</xsl:accumulator>


Seems to also work fine. So in that case one doesn't need to switch between XML and maps when processing the stored value but can continue to use the traditional XSLT processing of XML.

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.