Package client.net.sf.saxon.ce.tree.iter

Examples of client.net.sf.saxon.ce.tree.iter.AxisIterator


        switch (n1.getNodeKind()) {
            case Type.ELEMENT:
                if (n1.getFingerprint() != n2.getFingerprint()) {
                    return false;
                }
                AxisIterator a1 = n1.iterateAxis(Axis.ATTRIBUTE);
                AxisIterator a2 = n2.iterateAxis(Axis.ATTRIBUTE);
                if (Count.count(a1.getAnother()) != Count.count(a2)) {
                    return false;
                }
                while (true) {
                    NodeInfo att1 = (NodeInfo)a1.next();
                    if (att1 == null) break;

                    AxisIterator a2iter = n2.iterateAxis(Axis.ATTRIBUTE,
                                            new NameTest(Type.ATTRIBUTE, att1.getFingerprint(), pool));
                    NodeInfo att2 = (NodeInfo)a2iter.next();

                    if (att2==null) {
                        return false;
                    }
                    if (!deepEquals(att1, att2, collator, config)) {
                        return false;
                    }
                }

                // fall through
            case Type.DOCUMENT:
                AxisIterator c1 = n1.iterateAxis(Axis.CHILD);
                AxisIterator c2 = n2.iterateAxis(Axis.CHILD);
                while (true) {
                    NodeInfo d1 = (NodeInfo)c1.next();
                    while (d1 != null && isIgnorable(d1))  {
                        d1 = (NodeInfo)c1.next();
                    }
                    NodeInfo d2 = (NodeInfo)c2.next();
                    while (d2 != null && isIgnorable(d2))  {
                        d2 = (NodeInfo)c2.next();
                    }
                    if (d1 == null || d2 == null) {
                        return (d1 == d2);
                    }
                    if (!deepEquals(d1, d2, collator, config)) {
View Full Code Here


     */

    protected ItemType getCommonChildItemType() {
        final TypeHierarchy th = getConfiguration().getTypeHierarchy();
        ItemType t = EmptySequenceTest.getInstance();
        AxisIterator children = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo next = (NodeInfo)children.next();
            if (next == null) {
                return t;
            }
            if (next instanceof StyleElement) {
                ItemType ret = ((StyleElement)next).getReturnedItemType();
View Full Code Here

        if (!(this instanceof LiteralResultElement)) {
            processDefaultCollationAttribute("");
        }
        staticContext = new ExpressionContext(this);
        processAttributes();
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                return;
            }
            if (child instanceof StyleElement) {
                ((StyleElement)child).processAllAttributes();
View Full Code Here

     * @return the last child instruction, or null if there are no child instructions
     */

    protected StyleElement getLastChildInstruction() {
        StyleElement last = null;
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                return last;
            }
            if (child instanceof StyleElement) {
                last = (StyleElement)child;
View Full Code Here

     * Fix up references from XPath expressions. Overridden for function declarations
     * and variable declarations
     */

    public void fixupReferences() throws XPathException {
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                return;
            }
            if (child instanceof StyleElement) {
                ((StyleElement)child).fixupReferences();
View Full Code Here

            } else if (reportingCircumstances == REPORT_UNLESS_FORWARDS_COMPATIBLE
                    && !forwardsCompatibleModeIsEnabled()) {
                compileError(validationError);
            } else if (reportingCircumstances == REPORT_UNLESS_FALLBACK_AVAILABLE) {
                boolean hasFallback = false;
                AxisIterator kids = iterateAxis(Axis.CHILD);
                while (true) {
                    NodeInfo child = (NodeInfo)kids.next();
                    if (child == null) {
                        break;
                    }
                    if (child instanceof XSLFallback) {
                        hasFallback = true;
View Full Code Here

     * @param decl
     */

    protected void validateChildren(Declaration decl) throws XPathException {
        boolean containsInstructions = mayContainSequenceConstructor();
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof StyleElement) {
                if (containsInstructions && !((StyleElement)child).isInstruction()
View Full Code Here

     * @param sortRequired true if there must be at least one xsl:sort element
     * @throws XPathException if invalid
     */

    protected void checkSortComesFirst(boolean sortRequired) throws XPathException {
        AxisIterator kids = iterateAxis(Axis.CHILD);
        boolean sortFound = false;
        boolean nonSortFound = false;
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLSort) {
                if (nonSortFound) {
View Full Code Here

                //return result;
                break;
            }
            if (node.getNodeKind() == Type.TEXT) {
                // handle literal text nodes by generating an xsl:value-of instruction
                AxisIterator lookahead = node.iterateAxis(Axis.FOLLOWING_SIBLING);
                NodeInfo sibling = (NodeInfo)lookahead.next();
                if (!(sibling instanceof XSLParam || sibling instanceof XSLSort)) {
                    // The test for XSLParam and XSLSort is to eliminate whitespace nodes that have been retained
                    // because of xml:space="preserve"
                    Instruction text = new ValueOf(new StringLiteral(node.getStringValue()), false);
                    text.setSourceLocator(this);
View Full Code Here

    protected Expression fallbackProcessing(Executable exec, Declaration decl, StyleElement instruction)
            throws XPathException {
        // process any xsl:fallback children; if there are none,
        // generate code to report the original failure reason
        Expression fallback = null;
        AxisIterator kids = instruction.iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLFallback) {
                //fallback.setLocationId(allocateLocationId(getSystemId(), child.getLineNumber()));
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.tree.iter.AxisIterator

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.