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 12:12:00 PM
On Jun 6, 2:02=A0pm, Simon Wright <si...@pushface.org> wrote:
> Ramon F Herrera <ra...@conexus.net> writes:
>
>
>
>
>
>
>
>
>
> > A few years back, after having developed my very own implementation of
> > an XML retrieval function, I discovered that I had just reinvented the
> > wheel: it is known as XPath. My wheel only handled the simplest
> > format, though.
>
> > I have grown comfortable with several XPath implementations, until
> > now, that is.
>
> > Now I am stuck with many tables which are very similar, and I get too
> > many hits. The items that I need are easily retrieved by these paths:
>
> > /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']
>

 > Then wouldn't
 >
 > =A0 /root/table[@tagname=3D'intermediate_joints']/intermediate_joints/
joint_label
 >
 > do the trick?

That is a very good question... Already tried it.

The problem is that deeper down the tables become different. That path
"joins" 2 tables that I need separated.

-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.