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

Re: Using sibling value in streaming mode

Subject: Re: Using sibling value in streaming mode
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 31 Aug 2019 08:36:33 -0000
Re:  Using sibling value in streaming mode
Am 31.08.2019 um 10:25 schrieb Michael Kay mike@xxxxxxxxxxxx:
If you want to achieve some level of streaming within the map, then
clearly it's not going to be perfect streaming; in the worst case, if
the "id" comes last, then you're going to have to buffer something in
memory. Burst-mode streaming buffers the input in memory; an
alternative is to buffer the output, which you can achieve using xsl:fork:

<xsl:template match="map" mode="streamed">
B  B <xsl:fork>
B  B  B <xsl:sequence>
B  B  B  B  <id>{string[@key='id']}</id>
B  B  B <xsl:sequence>
B  B  B <xsl:sequence>
B  B  B  B  <xsl:apply-templates select="string[not(@key='id')]"
mode="streamed"/>
B  B  B <xsl:sequence>
B  B </xsl:fork>
</xsl:template>



Does xsl:fork as outlined above really help for the below wanted output where you need the "id" to construct the "item" for each of the string[not(@key='id')] elements?

Required output:

<items>
B B B <item>
B B B B B B <id>123456789</id>
B B B B B B <key>key1<key>
B B B B B B <val>value1</val>
B B B </item>
B B B ...
B B B <item>
B B B B B B <id>123456789</id>
B B B B B B <key>id<key>
B B B B B B <val>123456789</val>
B B B </item>
B B B ...
B B B <item>
B B B B B B <id>123456789</id>
B B B B B B <key>keyN<key>
B B B B B B <val>valueN</val>
B B B </item>
B B B ...
</items>

The value of <string key="id"> is used as <id> in <item> elements. The
problem is that <string key="id"> can occur in any position in the
<map>.

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.