Posted By: VB Man | Sep 29th, 2008 @ 9:11 PM
page 1 of 1
Comments: 4 | Views: 490
VB Man
VB Man
Year of the Linux MCE.
HI ALL. I have the following element:

<child firstname="smith" age="10" dayborn="19"/>

How can I extract the age of the child using XPath?

Much thanks.


Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
If for example you want to select it by firstname:

//child[@firstname='smith']/@age

(Note that this searches all child elements in the document. You might want something more precise than using // at the start)
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
Well, that's obviously not going to match the element from your original post since that child is 10, which is not less than 10.

A little more context would be nice, such as the entire XML document and style sheet.
page 1 of 1
Comments: 4 | Views: 490
Microsoft Communities