Package client.net.sf.saxon.ce.om

Examples of client.net.sf.saxon.ce.om.Item


    private static JavaScriptObject convertSequenceToArray(ValueRepresentation val, int seqLength) throws XPathException {
        JavaScriptObject jsItems = jsArray(seqLength);
        SequenceIterator iterator = Value.getIterator(val);
        int i = 0;
        while (true) {
            Item item = iterator.next();
            if (item == null) {
                break;
            }
            Object jsObject = convertToJavaScript(item);
            jsSetArrayItem(jsItems, i, jsObject);
View Full Code Here


    }
      
    public SequenceIterator iterate(XPathContext context) throws XPathException {
      try {
        if (localName.equals("window")) {
            Item item = new JSObjectValue(jsWindow());
            return SingletonIterator.makeIterator(item);

        } else if (localName.equals("eval")) {
          String script = argument[0].evaluateAsString(context).toString();
          return evaluateJsFunction(script, context);
View Full Code Here

                // this provides the context for evaluating the sort key

        // initialise the array with data

        while (true) {
            Item item = base.next();
            if (item == null) {
                break;
            }
            if (count==allocated) {
                allocated *= 2;
View Full Code Here

            }
            SequenceIterator iter = val.iterate();
            while (true) {
                // if all items in the sequence are atomic (they generally will be, since this is
                // done at compile time), then return the sequence
                Item i = iter.next();
                if (i == null) {
                    return operand;
                }
                if (i instanceof NodeInfo) {
                    return this;
View Full Code Here

    * Evaluate as an Item. This should only be called if the Atomizer has cardinality zero-or-one,
    * which will only be the case if the underlying expression has cardinality zero-or-one.
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        Item i = operand.evaluateItem(context);
        return (i==null ? null : i.getTypedValue());
    }
View Full Code Here

    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        final XPathContextMajor cm = (XPathContextMajor)context;
        while (true) {
            Item item = operand.evaluateItem(context);
            UserFunction fn = cm.getTailCallFunction();
            if (fn == null) {
               return item;
            }
            if (fn != containingFunction) {
View Full Code Here

        SequenceIterator iter = sequence.iterate(context);
        int position = 1;
        int slot = getLocalSlotNumber();
        int pslot = -1;
        while (true) {
            Item item = iter.next();
            if (item == null) break;
            context.setLocalVariable(slot, item);
            if (pslot >= 0) {
                context.setLocalVariable(pslot, IntegerValue.makeIntegerValue(position++));
            }
View Full Code Here

     *                the current variables, etc.
     */

    public void process(XPathContext context) throws XPathException {
        SequenceReceiver out = context.getReceiver();
        Item item = asItem();
        if (item != null) {
            out.append(item, NodeInfo.ALL_NAMESPACES);
        }
    }
View Full Code Here

        // logic is used for the SOME and EVERY operators

        final boolean some = (operator==Token.SOME);
        int slot = getLocalSlotNumber();
        while (true) {
            final Item it = base.next();
            if (it == null) {
                break;
            }
            context.setLocalVariable(slot, it);
            if (some == action.effectiveBooleanValue(context)) {
View Full Code Here

            ValueRepresentation repr = ((GroundedIterator)forwards).materialize();
            Value val = Value.asValue(repr);
            int length = val.getLength();
            return val.itemAt(length - 1);
        } else {
            Item current = null;
            while (true) {
                Item item = forwards.next();
                if (item == null) {
                    return current;
                }
                current = item;
            }
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.om.Item

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.