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

How to get page range within a group

Subject: How to get page range within a group
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Fri, 12 Sep 2008 11:08:34 +0530
 How to get page range within a group
Hi All,
I am not able to get the appropriate result. Can anybody let me know about the mistake I am doing. I want a page range within <doc>.

<!-- INPUT -->
<pb n="FFCP-i"/>
<p><pb n="FFCP-ii"/></p>
<doc id="a1">
<pb n="FFCP-1"/>
<p><pb n="FFCP-2"/></p>
<p><b><pb n="FFCP-3"/></b></p>

<doc id="a2">
<pb n="FFCP-4"/>
<p><pb n="FFCP-5"/></p>
<p><b><pb n="FFCP-6"/></b></p>

<!--XSLT -->
<xsl:template match="docGroup/doc">
	<xsl:call-template name="citationPageRange"/>

<xsl:template name="citationPageRange">
<xsl:if test="ancestor::docGroup">
<xsl:if test="//doc//pb[position()=1]">
<xsl:variable name="fpage" select="substring-after(//doc//pb[position()=1]/@n,'-')"/>
<xsl:text>pp. </xsl:text>
<xsl:value-of select="$fpage"/>
<xsl:if test="//doc//pb[position()=last()]">
<xsl:variable name="lpage" select="substring-after(//doc//pb[position()=last()]/@n,'-')"/>
<xsl:value-of select="$lpage"/>

<!-- OUTPUT -->
pp. 1--3

Thanks in advance!!!

Current Thread


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.
First Name
Last Name
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.