This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

counting problem


I've got a xml structure that consists of A's, R's and S's.
S's can contain any number of R's and R's can contain any number of any of
the 3 elements.
For any given S node in the document I need to count all it's descendant
A's but only those descended from the first R in every S.

So if I have something like this:
<S>
  <R>
    <A/> *
    <A/> *
    <S>
      <R><A/> * </R>
      <R><A/></R>
    </S>
  </R>
  <R>
    <A>
  <R>
</S>

It should count 3 A's, the ones I marked.

Is there a way to do that in xpath alone?
If not, I've written a template that visits all the nodes I want and
returns each count.. the problem is it concatenates them rather than
adding. Is there a way to add those returned values?

Thanks for any help,
Konrad


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]