Altova Mailing List Archives
>comp.text.xml Archive Home
>Thread Prev - Re: I guess XPath is not as straightforward as I thought...
Re: I guess XPath is not as straightforward as I thought...
Date: 6/6/2012 10:33:00 AM
On Jun 6, 12:22=A0pm, Alain Ketterlin <al...@dpt-info.u-strasbg.fr> wrote: > Ramon F Herrera <ra...@conexus.net> writes: > > [...] > > > /root/table/intermediate_joints/joint_label > > /root/table/intermediate_joints/joint_label > > > Since those numbers (9 and 10) only work for one XML file, how do I > > determine them in a general way? > > > The following xpath hits those tables, but I need to retrieve the > > values 9 and 10. > > > /root/table[@tagname=3D'intermediate_joints'] > > Something like this should do: > > count(/root/table[@...]/preceding-sibling::table) > > -- Alain. Thanks, Alain. I tried it: count(/root/table[@tagname=3D'intermediate_joints']/preceding- sibling::table) but I only got one table, the output of the path above is 9. -Ramon