Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass DOM Document created using Axiom to evaluate XPath in Psychopath processor
    text
    copied!<p>Currently Psychopath Xpath processor uses XercesLoader class to load bytestream and create org.w3c.dom.Document and it can be passed to evaluate the Xpath. </p> <pre><code> InputStream is = new FileInputStream("resources/test.xml"); DOMLoader loader = new XercesLoader(); Document doc = loader.load(is); </code></pre> <p>I created org.w3c.dom.Document using axiom and passed it to Psychopath. </p> <pre><code> InputStream is = new FileInputStream("resources/test.xml"); OMMetaFactory omMetaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); OMFactory omFac = omMetaFactory.getOMFactory(); OMXMLParserWrapper wrapper = OMXMLBuilderFactory.createOMBuilder(omFac, is) ; Document doc = (Document) wrapper.getDocument(); </code></pre> <p>But when passing doc2 it gives the error </p> <blockquote> <p>Exception in thread "main" org.w3c.dom.DOMException: NOT_SUPPORTED_ERR: The implementation does not support the requested type of object or operation. at org.apache.axiom.om.impl.dom.DOMUtil.newDOMException(DOMUtil.java:82) at org.apache.axiom.om.impl.dom.NodeImpl.compareDocumentPosition(NodeImpl.java:212) at org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.compare_node(NodeType.java:219) at org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.access$0(NodeType.java:207) at org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType$1.compare(NodeType.java:64) at java.util.TreeMap.put(TreeMap.java:545) at java.util.TreeSet.add(TreeSet.java:255) at java.util.AbstractCollection.addAll(AbstractCollection.java:342) at java.util.TreeSet.addAll(TreeSet.java:312) at org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType.linarize(NodeType.java:415) at org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.do_step(DefaultEvaluator.java:1165) at org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.visit(DefaultEvaluator.java:1249) at org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathExpr.accept(XPathExpr.java:43) at org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.do_expr(DefaultEvaluator.java:337) at org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.visit(DefaultEvaluator.java:366) at org.eclipse.wst.xml.xpath2.processor.ast.XPath.accept(XPath.java:58) at org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator.evaluate2(DefaultEvaluator.java:325) at org.eclipse.wst.xml.xpath2.processor.ast.XPath.evaluate(XPath.java:131) at psychopath.main(psychopath.java:85)</p> </blockquote> <p>Needs an explanation. How to pass the DOM Document instance made using axiom to Psychopath to evaluate XPath?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload