Open GoogleCodeExporter opened 9 years ago
can u give details of the piece of code you are using.
i mean are you using XMLDog or AsyncXMLReader....
Original comment by santhosh.tekuri@gmail.com
on 25 Jan 2012 at 12:52
If your xpath gets hit before reaching the invalid region of xml, then XMLDog
doesn't throw exception.
XMLDog stops reading xml file once all xpaths given are evaluated.
Original comment by santhosh.tekuri@gmail.com
on 25 Jan 2012 at 12:57
I'm using XMLDog.
This is a piece of code:
StringReader reader = new StringReader(message.getText());
DefaultNamespaceContext nsContext = new DefaultNamespaceContext();
XMLDog XML_DOG = new XMLDog(nsContext, null, null);
XPathResults results = XML_DOG.sniff(new InputSource(reader));
List<NodeItem> resultList = (List<NodeItem>) results.getResult(XML_DOG.addXPath("/XPATH"));
If input XML message is equal to "<root>" (element name without closing tag)
then "sniff" method doesn't throw any exception.
Original comment by surko...@gmail.com
on 13 Feb 2012 at 12:35
sniff method should be called after adding xpaths. but in your code sniff is
called first and then you are adding xpath. the correct code is:
StringReader reader = new StringReader(message.getText());
DefaultNamespaceContext nsContext = new DefaultNamespaceContext();
XMLDog XML_DOG = new XMLDog(nsContext, null, null);
Expression xpath = XML_DOG.addXPath("/XPATH");
XPathResults results = XML_DOG.sniff(new InputSource(reader));
List<NodeItem> resultList = (List<NodeItem>) results.getResult(xpath);
Original comment by santhosh.tekuri@gmail.com
on 13 Feb 2012 at 1:50
Original issue reported on code.google.com by
surko...@gmail.com
on 24 Jan 2012 at 9:12