Examples of SequenceExtent


Examples of client.net.sf.saxon.ce.value.SequenceExtent

        SequenceIterator forwards = argument[0].iterate(context);
        return getReverseIterator(forwards);
    }

    public static SequenceIterator getReverseIterator(SequenceIterator forwards) throws XPathException {
        SequenceExtent extent = new SequenceExtent(forwards);
        return extent.reverseIterate();
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceExtent

                    Expression cexp = new UntypedAtomicConverter(exp, (AtomicType)reqItemType, true, role);
                    ExpressionTool.copyLocationInfo(exp, cexp);
                    try {
                        if (exp instanceof Literal) {
                            exp = Literal.makeLiteral(
                                    new SequenceExtent(cexp.iterate(visitor.makeDynamicContext())).simplify());
                        } else {
                            exp = cexp;
                        }
                    } catch (XPathException err) {
                        err.maybeSetLocation(exp.getSourceLocator());
                        err.setErrorCode(role.getErrorCode());
                        throw err.makeStatic();
                    }
                    itemTypeOK = true;
                    suppliedItemType = reqItemType;
                }

                //   2b: some supplied values are untyped atomic. Convert these to the required type; but
                //   there may be other values in the sequence that won't convert and still need to be checked

                if ((suppliedItemType.equals(BuiltInAtomicType.ANY_ATOMIC))
                    && !(reqItemType.equals(BuiltInAtomicType.UNTYPED_ATOMIC) || reqItemType.equals(BuiltInAtomicType.ANY_ATOMIC))
                        && (exp.getSpecialProperties()&StaticProperty.NOT_UNTYPED) ==0 ) {

                    Expression cexp = new UntypedAtomicConverter(exp, (AtomicType)reqItemType, false, role);
                    ExpressionTool.copyLocationInfo(exp, cexp);
                    try {
                        if (exp instanceof Literal) {
                            exp = Literal.makeLiteral(
                                    new SequenceExtent(cexp.iterate(visitor.makeDynamicContext())).simplify());
                        } else {
                            exp = cexp;
                        }
                        suppliedItemType = exp.getItemType(th);
                    } catch (XPathException err) {
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceExtent

     * @return the corresponding SequenceValue
     */

    public GroundedValue materialize() {
        if (start==0 && end == items.length) {
            return new SequenceExtent(items);
        } else {
            SequenceExtent e = new SequenceExtent(items);
            return new SequenceExtent(e, start, end-start);
        }
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceExtent

                return new SingletonItem((NodeInfo)item);
            } else {
                return (AtomicValue)item;
            }
        } else {
            return new SequenceExtent(list);
        }
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceExtent

    public DocumentOrderIterator(SequenceIterator base, NodeOrderComparer comparer) throws XPathException {

        this.comparer = comparer;

        sequence = new SequenceExtent(base);
        //System.err.println("sort into document order: sequence length = " + sequence.getLength());
        if (sequence.getLength()>1) {
            //QuickSort.sort(this, 0, sequence.getLength()-1);
            GenericSorter.quickSort(0, sequence.getLength(), this);
            //GenericSorter.mergeSort(0, sequence.getLength(), this);
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceExtent

            case 0:
                return EmptySequence.getInstance();
            case 1:
                return (Item)list.get(0);
            default:
                return new SequenceExtent(list);
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.SequenceExtent

        } 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);
            }
            return new SequenceExtent(nodes);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.SequenceExtent

                return new SingletonItem((NodeInfo)item);
            } else {
                return (AtomicValue)item;
            }
        } else {
            return new SequenceExtent(list);
        }
    }
View Full Code Here

Examples of net.sf.saxon.value.SequenceExtent

                    nodes[i] = ((NodeOverNodeInfo)list.item(i)).getUnderlyingNodeInfo();
                } else {
                    return null;
                }
            }
            return new SequenceExtent(nodes);

            // Note, we accept the nodes in the order returned by the function; there
            // is no requirement that this should be document order.
        } else if (object instanceof NodeOverNodeInfo) {
            return ((NodeOverNodeInfo)object).getUnderlyingNodeInfo();
View Full Code Here

Examples of net.sf.saxon.value.SequenceExtent

                    final int len = list.getLength();
                    NodeInfo[] nodes = new NodeInfo[len];
                    for (int i = 0; i < len; i++) {
                        nodes[i] = wrapOrUnwrapNode(list.item(i), config);
                    }
                    return new SequenceExtent(nodes);
                }

                public ItemType getItemType() {
                    return AnyNodeTest.getInstance();
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.