[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Accumulator use

Subject: [xsl] Accumulator use
From: "cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Feb 2016 11:27:00 -0000

Hello ! 

I try to cache values who are in external files referenced from my
source file : 

<root><input href="1.xml"/><input href="2.xml"/>...</root> 

<root type="typeN">...</root> 

I want to create a map(xs:anyUri, xs:string), where key is the external
file URI, and value is always /*/@type in the file 

External files may be huge, and I'd like to stream them. I create an
accumulator, stream input files using this accumulator. 

<xsl:accumulator name="acc" as="map(xs:string, xs:string)"
   <xsl:accumulator-rule match="*[@value]">
      <xsl:sequence select="map:put($value, ./local-name(),

<xsl:mode name="m" streamable="yes"/> 

<xsl:template match="/">
   <xsl:stream href="../../test/resources/entries.xml"
      <xsl:apply-templates mode="m"/>
   <!-- do here something that uses the accumulator -->

How can I access to the accumulator after stream processing ? I'd like
to write the map content to the output. Is it possible ? 

Best regards, 


Current Thread