[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Kosher XSLT 3.0 numbering solution?
On Thu, 2016-09-01 at 13:51 +0000, David Sewell dsewell@xxxxxxxxxxxx wrote: >B > B B B <xsl:variable name="bodyPageNo" select="0" as="xs:integer" > saxon:assignable="yes"/> > B B B <xsl:template match="pb"> > B B B B B <xsl:variable name="pageNumber"> > B B B B B B B B <saxon:assign name="bodyPageNo" select=" > B B B B B B B B B B B if (@n) then xs:integer(@n) else $bodyPageNo + 1 > B B B B B B B B B B B "/> > B B B B B B B B <xsl:value-of select="$bodyPageNo"/> > B B B B B </xsl:variable> But surely it's not that hard to write a recursive template or function that finds the previous page break and adds one to it where needed? Roughly, If this is the first page number then (@n, 1)[1] If @n is supplied then @n Otherwise 1 + pagenumber( (preceding::pagebreak)[1] ) If performance is an issue you can ask saxon to memoize (remember) the function results. Liam
|
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
|