|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using sibling value in streaming mode
On 30.08.2019 23:18, Martynas JuseviD ius martynas@xxxxxxxxxxxxx wrote: 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>. How large are the maps? Can't you afford to switch to "normal" processing with e.g. <xsl:template match="map"> <xsl:apply-templates select="copy-of()" mode="non-streaming"/> </xsl:template> <xsl:template match="map" mode="non-streaming">
<items>
<xsl:apply-templates select="string[not(@key = 'id')]" mode="#current">
<xsl:with-param name="id" select="string[@key = 'id']"/>
</xsl:apply-templates>
</items>
</xsl:template><xsl:template match="string" mode="non-streaming">
<xsl:param name="id"/>
<item xsl:expand-text="yes">
<id>{$id}</id>
<key>{@key}</key>
<val>{.}</val>
</item>
</xsl:template>? Some buffering will be needed, converting the whole XML map structure in an XPath 3.1 map stored in an accumulator might also work.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








