Search in sources :

Example 51 with NodeInfo

use of net.sf.saxon.om.NodeInfo in project checkstyle by checkstyle.

the class FollowingIterator method next.

/**
 * Get the next item in the sequence.
 *
 * @return the next Item. If there are no more nodes, return null.
 */
@Override
public NodeInfo next() {
    NodeInfo result = null;
    do {
        if (descendantEnum != null) {
            result = descendantEnum.next();
        }
        if (result == null && siblingEnum != null) {
            result = siblingEnum.next();
            if (result == null) {
                siblingEnum = null;
            } else {
                descendantEnum = result.iterateAxis(AxisInfo.DESCENDANT);
            }
        }
        if (result == null) {
            final NodeInfo parent = ancestorEnum.next();
            if (parent == null) {
                break;
            }
            siblingEnum = parent.iterateAxis(AxisInfo.FOLLOWING_SIBLING);
        }
    } while (result == null);
    return result;
}
Also used : NodeInfo(net.sf.saxon.om.NodeInfo)

Example 52 with NodeInfo

use of net.sf.saxon.om.NodeInfo in project checkstyle by checkstyle.

the class ReverseListIterator method next.

/**
 * Get the next item in the sequence.
 *
 * @return the next Item. If there are no more nodes, return null.
 */
@Override
public NodeInfo next() {
    final NodeInfo result;
    if (index == -1) {
        result = null;
    } else {
        result = items.get(index);
        index--;
    }
    return result;
}
Also used : NodeInfo(net.sf.saxon.om.NodeInfo)

Aggregations

NodeInfo (net.sf.saxon.om.NodeInfo)52 Test (org.junit.Test)21 XPathExpression (javax.xml.xpath.XPathExpression)16 Test (org.junit.jupiter.api.Test)14 Processor (net.sf.saxon.s9api.Processor)8 Configuration (net.sf.saxon.Configuration)7 DetailAST (com.puppycrawl.tools.checkstyle.api.DetailAST)5 DocumentWrapper (org.sirix.saxon.wrapper.DocumentWrapper)5 NameTest (net.sf.saxon.pattern.NameTest)4 SaxonApiException (net.sf.saxon.s9api.SaxonApiException)4 XQueryCompiler (net.sf.saxon.s9api.XQueryCompiler)3 XQueryExecutable (net.sf.saxon.s9api.XQueryExecutable)3 AxisIterator (net.sf.saxon.tree.iter.AxisIterator)3 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Item (net.sf.saxon.om.Item)2 Serializer (net.sf.saxon.s9api.Serializer)2 NodeReadTrx (org.sirix.api.NodeReadTrx)2 NodeList (org.w3c.dom.NodeList)2