|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Xpath to count occurances within a single parent
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|







