Comment #1 on issue 41 by
auste...@gmail.com: Handling the "Content not
This was my workaround. I wish I didn't have to do this but since xmltool
couldn't read the file , I was required to do this :
public String getValByXpath( String xpathstr ) {
// can't use XMLDoc here because XmlInvoiceClient stores invalidly
encoded xml
// so, I do this all manually below just to get the Assert
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
XPathExpression xp;
Document doc;
String success = null;
try {
builder = factory.newDocumentBuilder();
doc = builder.parse( "result.xml" );
XPathFactory xPathfactory = XPathFactory.newInstance();
XPath xpath = xPathfactory.newXPath();
xp = xpath.compile( xpathstr );
success = xp.evaluate( doc );
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (XPathExpressionException e) {
e.printStackTrace();
}
return success;
}