[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Count of previous nodes until a child node of a previo
Hi all,
I'm the first to admit I'm not XSL expert, but I've been stuck on this one for hours and I'm hoping someone can help me out. I've found similar posts where a user is looking for a count of following nodes until an attribute is found, but not close enough to what I'm looking to do. Assuming we have this XML structure: <body> <p> text </p> <p> text2 </p> <p> <component name="newpage" /> </p> <p> text3 </p> <p> text4 </p> <p> text5 </p> <p> text6 </p> <p> <component name="newpage" /> </p> <p> text7 </p> <p> text8 </p> <p> text9 </p> </body>
Examples: If I am on the p node whose value is "text8", I should get a count of 1 because there is only 1 previous p node before I find a p node with the component node with attribute name=newpage. p node value Count text 0 text2 1 text3 0 text4 1 text5 2 text6 3 text7 0 text8 1 text9 2 You will be my personal hero is you can help me out! Much thanks, Jeremy
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! 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
|