Package net.sf.saxon.value

Examples of net.sf.saxon.value.SingletonItem


        if (length == 0) {
            return EmptySequence.getInstance();
        } else if (length == 1) {
            Item item = (Item)list.get(0);
            if (item instanceof NodeInfo) {
                return new SingletonItem((NodeInfo)item);
            } else {
                return (AtomicValue)item;
            }
        } else {
            return new SequenceExtent(list);
View Full Code Here


        this.config = config;
    }

    protected SaxonXQItemType(NodeInfo node) {
        config = node.getConfiguration();
        itemType = new SingletonItem(node).getItemType(config.getTypeHierarchy());
    }
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 SingletonItem(item));
                }
            } catch (Exception err) {
                // ignore the exception and try again at run-time
                return this;
            }
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 SingletonItem(item);
    }
View Full Code Here

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

    public GroundedValue materialize() {
        if (item instanceof AtomicValue) {
            return (AtomicValue)item;
        } else {
            return new SingletonItem(item);
        }
    }
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 SingletonItem(first)));

        return new FilterIterator(ns1, filter, context);

    }
View Full Code Here

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

        Expression filter = new IdentityComparison(
                new ContextItemExpression(),
                Token.FOLLOWS,
                new Literal(new SingletonItem(first)));

        return new FilterIterator(ns1, filter, context);

    }
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 SingletonItem(item));
                }
            } catch (Exception err) {
                // ignore the exception and try again at run-time
                return this;
            }
View Full Code Here

TOP

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

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.