View Single Post
  #3 (permalink)  
Old March 2nd, 2010, 08:46 AM is offline
Authorized User
Join Date: Feb 2009
Location: Gurgaon
Posts: 31
Thanks: 6
Thanked 1 Time in 1 Post
Send a message via MSN to

Hi Michael,

Thanks for your response!

I run the suggested code but its creating the page range for first and last node of group whereas I need range only for continuous page numbers. In the below example (red) you can see input xml file coding and blue contains output xml coding. The blue part contains two information first is continuous page range and independent page number.


and need to transform like this:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
 <xsl:template match="index-item">
  <xsl:for-each-group select="link" group-adjacent="number(link) - position()">
  <xsl:for-each select="current-group()">
    <xsl:when test="position() = 1 and count(current-group()) = 1">
     <xsl:copy-of select="."/>
    <xsl:when test="position() = 1">
     <link><xsl:value-of select="concat(., '--', current-group()[last()])"/></link>
Could you please look into this and do the needful.

Anil Yadav
Reply With Quote