Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recursion (or some kind of loop?) 1

Status
Not open for further replies.

ironyx

Technical User
Nov 13, 2001
134
US
I have an xml doc

<record ID="1">
<zone>1</zone>
<region>1</region>
</record>
<record ID="2">
<zone>1</zone>
<region>2</region>
</record>
<record ID="3">
<zone>2</zone>
<region>1</region>
</record>
<record ID="4">
<zone>3</zone>
<region>1</region>
</record>

I have half inherited this program to add "features". One of them was to insert a page break by zone grouping. I did this by:
<xsl:variable name="zone1">
<xsl:value-of select = "zone"/>
</xsl:variable>
<xsl:variable name="zone2">
<xsl:value-of select = "following::zone"/>
</xsl:variable>
<xsl:if test="$zone1 != $zone2 and position() != last()">
Probably not the best idea, but this is my first time (except for playing around) with xsl... so I am winging it...
The issue is, they want a "page of page" dispay above each page break as it prints. I have read about the recursive template thing but don't really understand the calling templates... etc. I only was given a few hours to do this (which I have now passed) so any suggestions would be great.

Thanks,
Va.
 
Aha! Grouping. You need to understand the Muench Method, which you will find illustrated here thread426-1210886; look for the rather lengthy post with code later in the thread.

Sorry about the time limit thing. We'll try to help.

Tom Morrison
 
That was great... I was spinning my wheels, rewrote what I did a little added a position and a count and I got page breaks inside the loops and a page of page to show. That was so simple and yet very effective, very nice. You are my hero!!!

Thank you so much for taking the time to help!

Va. :) <-- Very relieved work horse!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top