xsl-list
[Top] [All Lists]

[xsl] Number of elements with a given attribute

2009-12-17 19:49:26
Hello,

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

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

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

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 
on.

<xsl:value-of select="count(preceding::verse[(_at_)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 
part.

Could someone help me?

Thanks in advance,
Ph. Faehndrich

--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>