[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
On 08.05.2018 17:19, Geert Bormans geert@xxxxxxxxxxxxxxxxxxx wrote:
All,
I have a potentially huge tabular structure in an XML file: one "table''
element, many "row" elements, each having a series of attributes
I want to process them using a streaming XSLT, but I am hitting an issue
I want to use information from the first row in a header construct, in a
way using the first row information twice
That is fairly easy done if the result were something like CSV, because
then I can deal with the header and first row in one go
but now I need the header in some sort of metadata section at the start
of the document
and all the rows including row one in an adjacent structure, but wrapped
(the results of the row processing in a container)
I tried to create the full structure in a template for the first row and
process the following siblings of the first row... but that can't be
done "when the context posture is striding" (sic)
Any ideas? Thanks,
How about setting up an accumulator
<xsl:accumulator name="first-row-values" as="map(xs:string, xs:string)"
initial-value="map{}" streamable="yes">
<xsl:accumulator-rule match="table/row[1]"
select="map:merge(@*!map { node-name() : data(.) })"/>
</xsl:accumulator>
then you can use that map in all following rows.
|
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
RSS 2.0 |
|
Atom 0.3 |
|
|