Search in sources :

Example 1 with XOMDocumentWrapper

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);
}
Also used : XMLTableNode(org.teiid.query.processor.relational.XMLTableNode) Node(nu.xom.Node) RelationalNode(org.teiid.query.processor.relational.RelationalNode) XOMDocumentWrapper(net.sf.saxon.option.xom.XOMDocumentWrapper) DocType(nu.xom.DocType)

Aggregations

XOMDocumentWrapper (net.sf.saxon.option.xom.XOMDocumentWrapper)1 DocType (nu.xom.DocType)1 Node (nu.xom.Node)1 RelationalNode (org.teiid.query.processor.relational.RelationalNode)1 XMLTableNode (org.teiid.query.processor.relational.XMLTableNode)1