<?xml version="1.0" encoding="UTF-8"?> <CreateOrderResponse xmlns="urn:schemas-biztalk-org/biztalk-0.81.xml"> <BizTalk> <Route>any route</Route> </BizTalk> </CreateOrderResponse>
String xmlString = <the xml above>; String xpath = "//CreateOrderResponse/BizTalk";
Document document = XMLUnit.buildControlDocument(xmlString); SimpleXpathEngine engine = new SimpleXpathEngine(); engine.evaluate(xpath, document);
The node BizTalk is not found. If I change the attribute "xmlns" to something else, everything is fine.
The xml from my customer has this "xmlns" attribute not in the root element. What could I do there?
Please help me with this, thanks in advance, Sebastian
I am using a workaround now. I am replacing the xmlns in the actual and expected xmlString. Any explanations, why this is needed, would be welcome.
Log in to post a comment.
<?xml version="1.0" encoding="UTF-8"?>
<CreateOrderResponse xmlns="urn:schemas-biztalk-org/biztalk-0.81.xml">
<BizTalk>
<Route>any route</Route>
</BizTalk>
</CreateOrderResponse>
String xmlString = <the xml above>;
String xpath = "//CreateOrderResponse/BizTalk";
Document document = XMLUnit.buildControlDocument(xmlString);
SimpleXpathEngine engine = new SimpleXpathEngine();
engine.evaluate(xpath, document);
The node BizTalk is not found. If I change the attribute "xmlns" to something else, everything is fine.
The xml from my customer has this "xmlns" attribute not in the root element. What could I do there?
Please help me with this,
thanks in advance,
Sebastian
I am using a workaround now. I am replacing the xmlns in the actual and expected xmlString. Any explanations, why this is needed, would be welcome.