![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XPath question [Thread Next] Re: XPath questionTo: NULL Date: 12/8/2006 11:55:00 AM Nevermind, I got it sorted out: count(preceding::item) - count(ancestor::checklist/preceding::item) + 1 PB wrote: > Hi, should be an easy question. I have XML which looks like the > following: > > > <book> > <checklist> > <item>Item</item> > <item>Item</item> > <sub-checklist> > <item>Item</item> > <item>Item</item> > <item>Item</item> > <item>Item</item> > <sub-checklist> > </checklist> > <checklist> > <item>Item</item> > <item>Item</item> > <sub-checklist> > <item>Item</item> > <item>Item</item> > <item>Item</item> > <item>Item</item> > <sub-checklist> > </checklist> > </book> > > > What I would like is to find the XPath that would label each "Item" > sequentially, but starting from 1 under each checklist. So in the > above example, I would like this output beside each item: > > 1, 2, 3, 4, 5, 6 > 1, 2, 3, 4, 5, 6 > > Any help would be much appreciated. > > Kind regards | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
