A
asd
Hi all,
My XML file is as shown below:
<?xml version="1.0" ?>
<messages>
<message>
<code>100</code>
<text>Unknown application error</text>
</message>
</messages>
My java code:
Element root_element = msg_doc.getDocumentElement();
String xpath_query = "/messages/message/code/text()='100'/parent::*";
NodeList nl=XPathAPI.selectNodeList(root_element, xpath_query);
What I want to do is select the parent node of the "code" node that
contains value 100?
But the code above gives me TransformationException.
Please help me out at the earliest. Thanks in advance for all your
help.
regards,
asd
My XML file is as shown below:
<?xml version="1.0" ?>
<messages>
<message>
<code>100</code>
<text>Unknown application error</text>
</message>
</messages>
My java code:
Element root_element = msg_doc.getDocumentElement();
String xpath_query = "/messages/message/code/text()='100'/parent::*";
NodeList nl=XPathAPI.selectNodeList(root_element, xpath_query);
What I want to do is select the parent node of the "code" node that
contains value 100?
But the code above gives me TransformationException.
Please help me out at the earliest. Thanks in advance for all your
help.
regards,
asd