[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: accumulators and continuous numbering
On 18.10.2019 21:08, Graydon graydon@xxxxxxxxx wrote:
So I'm converting a bunch of OOXML into DITA using XSLT 3 in oXygen withSaxon 9.8.0.12 PE.are many resulting DITA files per source OOXML document.thing with file numbers in attributes. This isn't an attempt to use streaming;I've got a few tens of MB of source.nodes. integers with the accumulator, I have to get the whole content set into the sametree before creating the numbering attributes. Yes, I think so, an accumulator is specific to a document. I get one continous sequence of numbers. If don't want to create a result tree then I think instead of <xsl:variable as="element(w:document)+" name="numberedSrc"> <xsl:apply-templates mode="fileNumber" select="$contentSet" /> </xsl:variable> you would need to use xsl:iterate select="$contentSet" and pass the latest accumulator on as the parameter of xsl:iterate, like I have done in https://xsltfiddle.liberty-development.net/bwdwrT <xsl:variable name="transformed-docs" as="element(root)*"> <xsl:iterate select="$docs"> <xsl:param name="sum" as="xs:integer" select="0"/> <xsl:apply-templates> <xsl:with-param name="sum" tunnel="yes" select="$sum"/> </xsl:apply-templates> <xsl:next-iteration> <xsl:with-param name="sum" select="$sum + accumulator-after('acc-example')"/> </xsl:next-iteration> </xsl:iterate> </xsl:variable> Not sure whether that is anything better, it seems to be a bit too complicated.
|
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
|