Confusing XPath problem
Posted: Fri Jan 06, 2006 12:29 pm
Hi all
I am having problems with extracting some thing out of one xml file. Please have a look at it.
Now I want to extract node "Name" if there is Symptom "weakness". So the answer should be "lungcancer" and "pneumonia". But I can't figure out what the XPath query should be. Can anyone please help me?
How to go up one or more than one level in xpath. For one level, getParentNode() works. But what about more than one level?
Thanks
I am having problems with extracting some thing out of one xml file. Please have a look at it.
Code: Select all
<diseases>
<disease>
<DocumentName>lungcancer</DocumentName>
<Name>lung cancer</Name>
<Symptoms>
<Symptom number="1">coughing blood</Symptom>
<Symptom number="2">weakness</Symptom>
</Symptoms>
</disease>
<disease>
<DocumentName>pneumonia</DocumentName>
<Name>pneumonia</Name>
<Symptoms>
<Symptom number="1">inflammation of lungs</Symptom>
<Symptom number="2">weakness</Symptom>
</Symptoms>
</disease>
</diseases>
How to go up one or more than one level in xpath. For one level, getParentNode() works. But what about more than one level?
Thanks