leegold2
Technical User
- Oct 10, 2004
- 116
given:
<links>
<l><a>1</a><n>Building</n></l>
<l><a>4</a><n>Community</n></l>
<l><a>2</a><n>Comedy</n></l>
<l><a>3</a><n>Computer</n></l>
</links>
What is an Xpath statement to find the maximum value in the "a" element node. It would be 4. I have searched and tried many examples with no luck. It must be simple? I could easily parse into an array and use an array's max function but would like to learn the xpath way.
Also I have been trying to determine if I have Xpath 1.0 or 2.0 and have searched to find what I have. In python and PHP how do I determine what version I have?
Many examples are extremely long and complicated and I have not found one that works. Help appreciated. I am using libxml2 in Python 2.6.
Is there a way to get Xpath 2.0 from command line in Linux if I don't have it?
Thanks,
Lee G.
<links>
<l><a>1</a><n>Building</n></l>
<l><a>4</a><n>Community</n></l>
<l><a>2</a><n>Comedy</n></l>
<l><a>3</a><n>Computer</n></l>
</links>
What is an Xpath statement to find the maximum value in the "a" element node. It would be 4. I have searched and tried many examples with no luck. It must be simple? I could easily parse into an array and use an array's max function but would like to learn the xpath way.
Also I have been trying to determine if I have Xpath 1.0 or 2.0 and have searched to find what I have. In python and PHP how do I determine what version I have?
Many examples are extremely long and complicated and I have not found one that works. Help appreciated. I am using libxml2 in Python 2.6.
Is there a way to get Xpath 2.0 from command line in Linux if I don't have it?
Thanks,
Lee G.