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

RE: Number of elements with a given attribute

Subject: RE: Number of elements with a given attribute
From: "Robby Pelssers" <robby.pelssers@xxxxxxxxx>
Date: Fri, 18 Dec 2009 09:55:53 +0100
RE:  Number of elements with a given attribute
Only count preceding siblings in that case

<xsl:value-of select="count(preceding-sibling::verse[@part != 'beginning'])

Robby Pelssers

-----Original Message-----
From: Faehndrich Philippe [mailto:phfaehndrich@xxxxxxxxxx]
Sent: Friday, December 18, 2009 1:49 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Number of elements with a given attribute


In a piece of theater, I have some verses that are split between different

All verses without a part attribute are complete verses.
<role name='...'>

The other are tagged on the following model:
<role name='...'>
  <verse part="beginning">...</verse>
<role name='...'>
  <verse part="continuation">...</verse>
<role name='...'>
  <verse part="continuation">...</verse>
<role name='...'>
  <verse part="end">...</verse>

I need to know if a continuation is the only one between beginning and end,
the first or the second of two, the first, second or third of three, and so

<xsl:value-of select="count(preceding::verse[@part != 'beginning']) "/> gives
me the count of all preceding verses with part attribute other
than "beginning" from the beginning of the piece, what is not what I want.
I wish to have the count of preceding parts of verse from the last beginning

Could someone help me?

Thanks in advance,
Ph. Faehndrich

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.