use of net.sf.saxon.option.xom.XOMDocumentWrapper in project teiid by teiid.
the class XQueryEvaluator method wrap.
/**
* Converts a xom node into something readable by Saxon
* @param node
* @param config
* @return
*/
static NodeInfo wrap(Node node, Configuration config) {
if (node == null)
// $NON-NLS-1$
throw new IllegalArgumentException("node must not be null");
if (node instanceof DocType)
// $NON-NLS-1$
throw new IllegalArgumentException("DocType can't be queried by XQuery/XPath");
Node root = node;
while (root.getParent() != null) {
root = root.getParent();
}
XOMDocumentWrapper docWrapper = new XOMDocumentWrapper(root, config);
return docWrapper.wrap(node);
}
Aggregations