@Test public void testResolveXpath_NamespaceWithNamespaceContext() throws Exception { MetadataXpathNodeQuery query = init(create()); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(XML_WITH_NAMESPACE); msg.addMetadata("xpathMetadataKey", "/svrl:schematron-output/svrl:failed-assert"); StaticNamespaceContext ctx = new StaticNamespaceContext(); Document doc = XmlHelper.createDocument(XML_WITH_NAMESPACE, ctx); Node result = query.resolveXpath(doc, new XPath(ctx), query.createXpathQuery(msg)); assertNotNull(result); }
@Override public Node resolveXpath(Document doc, XPath xpath, String expr) throws CoreException { return XpathQueryHelper.resolveSingleNode(doc, xpath, expr, allowEmptyResults()); }
MetadataXpathNodeQuery extends MetadataXpathQueryImpl implements XpathObjectQuery { @Override public Node resolveXpath(Document doc, XPath xpath, String expr) throws CoreException { return XpathQueryHelper.resolveSingleNode(doc, xpath, expr, allowEmptyResults()); } }
MetadataXpathNodeQuery extends MetadataXpathQueryImpl implements XpathObjectQuery { @Override public Node resolveXpath(Document doc, XPath xpath, String expr) throws CoreException { return XpathQueryHelper.resolveSingleNode(doc, xpath, expr, allowEmptyResults()); } MetadataXpathNodeQuery();  MetadataXpathNodeQuery(String metadataKey, String xpathMetadataKey); }
MetadataXpathNodeQuery extends MetadataXpathQueryImpl implements XpathObjectQuery { @Override public Node resolveXpath(Document doc, XPath xpath, String expr) throws CoreException { return XpathQueryHelper.resolveSingleNode(doc, xpath, expr, allowEmptyResults()); } MetadataXpathNodeQuery();  MetadataXpathNodeQuery(String metadataKey, String xpathMetadataKey); @Override Node resolveXpath(Document doc, XPath xpath, String expr); }
MetadataXpathNodeQuery extends MetadataXpathQueryImpl implements XpathObjectQuery { @Override public Node resolveXpath(Document doc, XPath xpath, String expr) throws CoreException { return XpathQueryHelper.resolveSingleNode(doc, xpath, expr, allowEmptyResults()); } MetadataXpathNodeQuery();  MetadataXpathNodeQuery(String metadataKey, String xpathMetadataKey); @Override Node resolveXpath(Document doc, XPath xpath, String expr);  }