camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From siddhesh <>
Subject RE: Difficulty in extracting data from CxfPayload
Date Mon, 22 Jun 2015 07:30:13 GMT
Hi Siano, Thanks 

I tried this code 

String bodyStr = exchange.getIn().getBody(String.class);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder;
builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new
XPath xPath = XPathFactory.newInstance().newXPath(); 

String address1 = xPath.evaluate("//loc:address/text()", document);
String address2 = xPath.evaluate("/loc:getLocation/loc:address", document);

but i get error when i try to access address in both ways using xpath
net.sf.saxon.trans.XPathException: Prefix loc has not been declared

Anything I am missing ? 

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message