I've got XPath of XML with it's structure like
<Statement xsi:type="conditionStatement"> <Id>CONDITION_0001</Id> <Bounds> <xValue>13</xValue> <yValue>145</yValue> <Height>402</Height> <Width>513</Width> </Bounds> ......... ......... </statement> Xpath takes me to xsi:type. But when I'm trying to get the name of node which is "statement" as expected, it's getting null.
My code for this is:-
nodeList = (NodeList) xPath.compile(xPathSrcFile).evaluate(xmlDocument, XPathConstants.NODESET); for (int i = 0; i < nodeList.getLength(); i++) { nodeList.item(i).getParentNode(); } For rest of the cases, code is working perfectly fine but when it gets to "xsi", code is throwing nullpointer exception.
Need some help to get node name from this.
No comments:
Post a Comment