// XmlObject xml = XmlObject.Factory.parse( response, options );
XmlObject xml = XmlUtils.createXmlObject(response, options);
String expandedPath = PropertyExpander.expandProperties(context, path);
XmlObject[] items = xml.selectPath(expandedPath);
AssertedXPathsContainer assertedXPathsContainer = (AssertedXPathsContainer) context
.getProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY);
XmlObject contentObj = null;
String expandedContent = PropertyExpander.expandProperties(context, expectedContent);
// stupid check for text selection for those situation that the
// selected
// text actually contains xml which should be compared as a string.
if (!expandedPath.endsWith("text()")) {
try {
// contentObj = XmlObject.Factory.parse( expandedContent, options
// );
contentObj = XmlUtils.createXmlObject(expandedContent, options);
} catch (Exception e) {
// this is ok.. it just means that the content to match is not
// xml
// but
// (hopefully) just a string
}
}
if (items.length == 0) {
throw new Exception("Missing content for xpath [" + path + "] in " + type);
}
options.setSavePrettyPrint();
options.setSaveOuter();
for (int c = 0; c < items.length; c++) {
try {
AssertedXPathImpl assertedXPathImpl = null;
if (assertedXPathsContainer != null) {
String xpath = XmlUtils.createAbsoluteXPath(items[c].getDomNode());
if (xpath != null) {
XmlObject xmlObj = items[c];
assertedXPathImpl = new AssertedXPathImpl(this, xpath, xmlObj);
assertedXPathsContainer.addAssertedXPath(assertedXPathImpl);
}
}
if (contentObj == null) {
if (items[c] instanceof XmlAnySimpleType && !(items[c] instanceof XmlQName)) {