use
preceding-sibling not preceding
Doesn?t work, because that will include ALL siblings even in other chapters.
Hello all,
I have the following XML structure
<book>
<chapter>
<caution/>
<caution/>
<caution/>
</chapter>
<chapter>
<sect1>
<caution/>
</sect1>
<caution/>
<caution/>
</chapter>
</book>
What I need is an XPATH statement that counts the number of preceding
cautions in each chapter. From any given chapter element.
EXAMPLE:
count(preceding::caution)!= 0
This XPATH works correctly for the first <chapter> but fails on the second
<chapter> because one <caution> is a child of <sect1>.
Is there a way to count preceding <cautions> within a <chapter> element
despite nesting?
Thanks,
David White
--~------------------------------------------------------------------
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>
--~--
-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]
Sent: Monday, August 28, 2006 12:34 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Xpath to count occurances within a single parent
--~------------------------------------------------------------------
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>
--~--
--~------------------------------------------------------------------
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>
--~--