[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Kosher XSLT 3.0 numbering solution?

Subject: Re: Kosher XSLT 3.0 numbering solution?
From: "Liam R. E. Quin liam@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 1 Sep 2016 15:27:04 -0000
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.