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

RE: Count problem

Subject: RE: Count problem
From: "Arun Sinha" <arunsinha666@xxxxxxxxxxx>
Date: Fri, 17 Sep 2004 10:32:26 +0000
xsl count problem

As you have not provided the actual XML/XSL I will try to explain it theoritically.

Select all descendents from route for that class.
And check if there is a parent called "subvolume".

I hope that makes sense or you can send me the complete XML/XSL.



From: "Sebastian Fey" <fey@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  Count problem
Date: Fri, 17 Sep 2004 11:43:41 +0200

Hi there,

I need to count nodes to number a ordered list in fo.
I now got an easy structure where a toc of all linked books is built up
The trick is that there is one structure file for all books i got, but
there result 3 different TOCs from, depending on the product_class
attribute of the single books.

Here is the actual structure:

<title>title of the volume</title>
<book fileref="book 1 (of class A)" />
<book fileref="book 2 (of class B)" />
<book fileref="book 3 (of class C)" />
<book fileref="book 4 (of class A)" />

Linking to books like this:

<book product_class="A">

<book product_class="B">

The xslt:

The script is runned three times, one run for each product class.
What it does is counting all books in a volume that have the actual

<xsl:number count="book[document(@fileref)/book/@product_class =
$product_class]" />

The output looks like (eg for class A):
Volume 1 title of the volume

1. title of book 1
2. title of book 4

This works so far, but now i have to change the structure to something like this

<title>title of the volume</title>
<book fileref="book 1 (of class A)" />
<book fileref="book 2 (of class C)" />
<book fileref="book 3 (of class B)" />
	<title>title of the subvolume</title>
	<book fileref="book 4 (of class A)" />
	<book fileref="book 5 (of class B)" />
<book fileref="book 6 (of class C)" />
<book fileref="book 7 (of class A)" />
<book fileref="book 8 (of class B)" />

The new output should look like (for Class A): ---------------------- Volume 1 title of the volume

1. title of book 1
2. title of the subvolume
   title of book 4
4. title of book 7

(for Class C):
Volume 1 title of the volume

1. title of book 2
2. title of book 6

(notice that the subvolume doesnt appear here cause it does not contain
any book of class C)

...nice. I really got no idea how to manage this.

Thx a lot in advance, sebastian

--+------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> --+--

Win a trip to Singapore! Experience the magic! http://eu.xmts.net/80450 Click here for details!

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.