Package net.sf.saxon.value

Examples of net.sf.saxon.value.SingletonNode


     * be converted, an exception should be thrown
     */

    public Value convertObjectToXPathValue(Object object, Configuration config) throws XPathException {
        if (object instanceof Node) {
            return new SingletonNode(wrapNode((Node)object, config));
        } else if (object instanceof Node[]) {
            NodeInfo[] nodes = new NodeInfo[((Node[])object).length];
            for (int i=0; i<nodes.length; i++) {
                nodes[i] = wrapNode(((Node[])object)[i], config);
            }
View Full Code Here


        // Filter ns1 to select nodes that come before this one

        Expression filter = new IdentityComparison(
                                    new ContextItemExpression(),
                                    Token.PRECEDES,
                                    new SingletonNode(first));

        return new FilterIterator(ns1, filter, context);

    }
View Full Code Here

     * @return the corresponding Value. If the value is a closure or a function call package, it will be
     * evaluated and expanded.
     */

    public GroundedValue materialize() {
        return new SingletonNode(item);
    }
View Full Code Here

        this.config = config;
    }

    protected SaxonXQItemType(NodeInfo node) {
        config = node.getConfiguration();
        itemType = new SingletonNode(node).getItemType(config.getTypeHierarchy());
    }
View Full Code Here

    public GroundedValue materialize() {
        if (item instanceof AtomicValue) {
            return (AtomicValue)item;
        } else {
            return new SingletonNode((NodeInfo)item);
        }
    }
View Full Code Here

                if (href.indexOf('#') >= 0) {
                    return this;
                }
                NodeInfo item = Document.preLoadDoc(href, expressionBaseURI, config, this);
                if (item!=null) {
                    return new Literal(new SingletonNode(item));
                }
            } catch (Exception err) {
                // ignore the exception and try again at run-time
                return this;
            }
View Full Code Here

        // Filter ns1 to select nodes that come before this one

        Expression filter = new IdentityComparison(
                                    new ContextItemExpression(),
                                    Token.PRECEDES,
                                    Literal.makeLiteral(new SingletonNode(first)));

        return new FilterIterator(ns1, filter, context);

    }
View Full Code Here

     * be converted, an exception should be thrown
     */

    public Value convertObjectToXPathValue(Object object, Configuration config) throws XPathException {
        if (object instanceof Node) {
            return new SingletonNode(wrapNode((Node)object, config));
        } else if (object instanceof Node[]) {
            NodeInfo[] nodes = new NodeInfo[((Node[])object).length];
            for (int i=0; i<nodes.length; i++) {
                nodes[i] = wrapNode(((Node[])object)[i], config);
            }
View Full Code Here

                if (href.indexOf('#') >= 0) {
                    return this;
                }
                NodeInfo item = Document.preLoadDoc(href, expressionBaseURI, config, this);
                if (item!=null) {
                    return new Literal(new SingletonNode(item));
                }
            } catch (Exception err) {
                // ignore the exception and try again at run-time
                return this;
            }
View Full Code Here

    public void process(XPathContext c) throws XPathException {
        try {
            ValueRepresentation actual = evaluateVariable(c);
            if (actual instanceof NodeInfo) {
                actual = new SingletonNode((NodeInfo) actual);
            }
            ((Value) actual).process(c);
        } catch (XPathException err) {
            err.maybeSetLocation(this);
            throw err;
View Full Code Here

TOP

Related Classes of net.sf.saxon.value.SingletonNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.