Package net.sf.saxon.om

Examples of net.sf.saxon.om.Item


        this.base = base;
        this.action = action;
    }

    public Item next() throws XPathException {
        Item nextItem;
        while (true) {
            if (results != null) {
                nextItem = results.next();
                if (nextItem != null) {
                    break;
                } else {
                    results = null;
                }
            }
            Item nextSource = base.next();
            if (nextSource != null) {
                // Call the supplied mapping function
                SequenceIterator obj = action.map(nextSource);

                // The result may be null (representing an empty sequence),
View Full Code Here


     *          if any dynamic error occurs evaluating the
     *          expression
     */

    public boolean effectiveBooleanValue(XPathContext context) throws XPathException {
        Item contextItem = context.getContextItem();
        return (contextItem instanceof NodeInfo) && pattern.matches(((NodeInfo)contextItem), context);
    }
View Full Code Here

        count = 0;

        // initialise the array with data

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

    }

    private boolean isInstance(SequenceIterator iter, XPathContext context) throws XPathException {
        int count = 0;
        while (true) {
            Item item = iter.next();
            if (item == null) break;
            count++;
            if (!targetType.matchesItem(item, false, context.getConfiguration())) {
                return false;
            }
View Full Code Here

        this.action = action;
        this.context = context;
    }

    public Item next() throws XPathException {
        Item nextItem;
        while (true) {
            if (stepIterator != null) {
                nextItem = stepIterator.next();
                if (nextItem != null) {
                    break;
View Full Code Here

    public static double max (SequenceIterator nsv) throws XPathException {
        double max = Double.NEGATIVE_INFINITY;
        try {
            while (true) {
                Item it = nsv.next();
                if (it == null) break;
                double x = Value.stringToNumber(it.getStringValueCS());
                if (Double.isNaN(x)) return x;
                if (x>max) max = x;
            }
            return max;
        } catch (NumberFormatException err) {
View Full Code Here

    public static double min (SequenceIterator nsv) throws XPathException {
        try {
            double min = Double.POSITIVE_INFINITY;
            while (true) {
                Item it = nsv.next();
                if (it == null) break;
                double x = Value.stringToNumber(it.getStringValueCS());
                if (Double.isNaN(x)) return x;
                if (x<min) min = x;
            }
            return min;
        } catch (NumberFormatException e) {
View Full Code Here

    /**
    * Evaluate as an Item. This should only be called if the AtomicSequenceConverter has cardinality zero-or-one
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        Item item = operand.evaluateItem(context);
        if (item==null) return null;
        return ((AtomicValue)item).convert(requiredPrimitiveType, true, context).asAtomic();
    }
View Full Code Here

    public static Value highest (SequenceIterator nsv) throws XPathException {
        try {
            double max = Double.NEGATIVE_INFINITY;
            ArrayList highest = new ArrayList();
            while (true) {
                Item it = nsv.next();
                if (it == null) break;
                double x = Value.stringToNumber(it.getStringValueCS());
                if (Double.isNaN(x)) return EmptySequence.getInstance();
                if (x==max) {
                    highest.add(it);
                } else if (x>max) {
                    max = x;
View Full Code Here

    public static Value lowest (SequenceIterator nsv) throws XPathException {
        try {
            double min = Double.POSITIVE_INFINITY;
            ArrayList lowest = new ArrayList();
            while (true) {
               Item it = nsv.next();
               if (it == null) break;
               double x = Value.stringToNumber(it.getStringValueCS());
               if (Double.isNaN(x)) return EmptySequence.getInstance();
               if (x==min) {
                   lowest.add(it);
               } else if (x<min) {
                   min = x;
View Full Code Here

TOP

Related Classes of net.sf.saxon.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.