Altova Mailing List Archives


Re: I guess XPath is not as straightforward as I thought...

From: Ramon F Herrera <ramon@-------.--->
To: NULL
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[9]/intermediate_joints/joint_label
> > /root/table[10]/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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.