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

position accross multiple node sets?

Subject: position accross multiple node sets?
From: "Jeff Barrett" <JBarrett@xxxxxxxxxxxxxxx>
Date: Tue, 13 Aug 2002 16:34:34 -0700
jeff barrett
I'm trying to create a numbered list of items as plain text output from an XML file.  In the interest of simplicity I've created a stripped down version of the problem below.

Let's say I've got XML that looks like this:

<items>
	<book>XSLT Programmers Reference</book>
	<book>Beginning XSLT</book>
	<car>
		<model>camry</model>
		<year>2001</year>
	</car>
	<car>
		<model>Explorer</model>
		<year>2001</year>
	</car>
	<car>
		<model>accord</model>
		<year>1995</year>
	</car>
	<car>
		<model>escort</model>
		<year>1999</year>
	</car>
</items>


I've created two templates that use position() to number the items.  One that processes the <book/> nodes into:

0. XSLT Programmers Reference
1. Beginning XSLT

The other uses grouping on the car's <year/> node to output:

0. 2001
1. 1995
2. 1999

Making the sum-total of this template's output:

0. XSLT Programmers Reference
1. Beginning XSLT
0. 2001
1. 1995
2. 1999

What I actually need output is:

0. XSLT Programmers Reference
1. Beginning XSLT
2. 2001
3. 1995
4. 1999


I've got some ideas how to solve this, but I can't seem to get my head around them.

ideas?

thanks,
+jeff

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.