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 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/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'] > > 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