XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Virginia OlderSubject: New to XSL with Recursion/Count/Loop Need
Author: Virginia Older
Date: 25 Jun 2006 12:35 PM
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. Am I making this more difficult than it is (if so, I will take my patronizing pat on the head now) or should I be perplexed?
I only was given a few hours to do this (which I have now passed) so any suggestions would be great. Please forgive my ignorance and accept my sincere appreciation for any help or direction!

Thank you so much,
Va.

Posttop
Ivan PedruzziSubject: New to XSL with Recursion/Count/Loop Need
Author: Ivan Pedruzzi
Date: 26 Jun 2006 04:31 PM
Hi Virginia,

It's quite difficult to help you without see the code around the XSLT fragment.

Have a look o the attached solution for

- group the result by ZONE
- create a breaking element each n elements

Hope this helps
Ivan Pedruzzi
Stylus Studio Team


Documentzone.xml


Documentzone.xsl

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.