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

Re: Dynamically generating lists of finite length

Subject: Re: Dynamically generating lists of finite length
From: Brendan Moran <bmoran@xxxxxxxxx>
Date: Tue, 17 Aug 2004 09:44:08 -0700
brendan moran
Hi,

Thanks, this helps a bunch, but I don't undestand quite what this bit does.

 <xsl:template match="node()|@*">
   <xsl:copy>
     <xsl:apply-templates select="node()|@*"/>
   </xsl:copy>
 </xsl:template>

Could you explain that to me?

Thanks,

Brendan Moran


Dimtre Novatchev wrote:


The following code presents one simple (not necessarily efficient)
compact and straightforward solution ot the splitting of "/a/b/c"
elements into pages of fixed length.

It doesn't address the other aspects of the problem, but these should
not be difficult, too:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output omit-xml-declaration="yes" indent="yes"/>

<xsl:variable name="vRecsPerPage" select="11"/>

<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*/b/c">
<xsl:variable name="vPos">
<xsl:number count="/*/b/c" level="any"/>
</xsl:variable>
<xsl:if test="$vPos mod $vRecsPerPage = 1">
<page number="{ceiling($vPos div $vRecsPerPage)}"/>
</xsl:if>
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>



Cheers,


Dimitre Novatchev.

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.