Package net.sf.saxon.om

Examples of net.sf.saxon.om.NodeInfo.iterateAxis()


                break;
            }
            if (curr instanceof XSLWhen) {
                conditions[w] = ((XSLWhen)curr).getCondition();
                Expression b = ((XSLWhen)curr).compileSequenceConstructor(
                        exec, curr.iterateAxis(Axis.CHILD), true);
                if (b == null) {
                    b = Literal.makeEmptySequence();
                }
                try {
                    b = makeExpressionVisitor().simplify(b);
View Full Code Here


                }
                w++;
            } else if (curr instanceof XSLOtherwise) {
                conditions[w] = Literal.makeLiteral(BooleanValue.TRUE);
                Expression b = ((XSLOtherwise)curr).compileSequenceConstructor(
                        exec, curr.iterateAxis(Axis.CHILD), true);
                if (b == null) {
                    b = Literal.makeEmptySequence();
                }
                try {
                    b = makeExpressionVisitor().simplify(b);
View Full Code Here

        NodeInfo root = node.getDocumentRoot();
        if (root==null) {
            return null;
        }
        AxisIterator children =
            root.iterateAxis(Axis.CHILD, NodeKindTest.ELEMENT);
        return (Element)wrap((NodeInfo)children.next());
    }   

     protected static NodeList getElementsByTagName(NodeInfo node, String tagname) {
         AxisIterator allElements = node.iterateAxis(Axis.DESCENDANT);
View Full Code Here

            }
            break;
        }

        SequenceIterator documents =
                top.iterateAxis(Axis.CHILD, NodeKindTest.ELEMENT);

        return new MappingIterator(documents, this, context, null);

    }
View Full Code Here

public class NamespaceForPrefix extends SystemFunction {

    public Item evaluateItem(XPathContext context) throws XPathException {
        NodeInfo element = (NodeInfo)argument[1].evaluateItem(context);
        String prefix = argument[0].evaluateItem(context).getStringValue();
        SequenceIterator nsNodes = element.iterateAxis(Axis.NAMESPACE);
        while (true) {
            NodeInfo ns = (NodeInfo)nsNodes.next();
            if (ns == null) {
                break;
            }
View Full Code Here

    * Iterator over the results of the expression
    */

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        NodeInfo element = (NodeInfo)argument[0].evaluateItem(context);
        SequenceIterator nsNodes = element.iterateAxis(Axis.NAMESPACE);
        return new MappingIterator(nsNodes, this, null, null);
    }

    /**
    * Map a namespace node to its name (the namespace prefix)
View Full Code Here

        NodeInfo root = node.getDocumentRoot();
        if (root==null) {
            return null;
        }
        AxisIterator children =
            root.iterateAxis(Axis.CHILD, NodeKindTest.ELEMENT);
        return (Element)wrap((NodeInfo)children.next());
    }   

     protected static NodeList getElementsByTagName(NodeInfo node, String tagname) {
         AxisIterator allElements = node.iterateAxis(Axis.DESCENDANT);
View Full Code Here

            switch (node.getNodeKind()) {
                case Type.DOCUMENT: {
                    if (node instanceof TinyNodeImpl) {
                        return new TinyTreeEventIterator(((TinyNodeImpl)node));
                    } else {
                        SequenceIterator content = node.iterateAxis(Axis.CHILD);
                        EventIterator contentEvents = new EventIteratorOverSequence(content);
                        return new BracketedDocumentIterator(
                                StartDocumentEvent.getInstance(),
                                new Decomposer(contentEvents, config),
                                EndDocumentEvent.getInstance());
View Full Code Here

                }
                case Type.ELEMENT: {
                    if (node instanceof TinyNodeImpl) {
                        return new TinyTreeEventIterator(((TinyNodeImpl)node));
                    } else {
                        SequenceIterator content = node.iterateAxis(Axis.CHILD);
                        EventIterator contentEvents = new EventIteratorOverSequence(content);
                        StartElementEvent see = new StartElementEvent(config);
                        see.setNameCode(node.getNameCode());
                        see.setTypeCode(node.getTypeAnnotation());
                        see.setLocalNamespaces(node.getDeclaredNamespaces(null));
View Full Code Here

                        EventIterator contentEvents = new EventIteratorOverSequence(content);
                        StartElementEvent see = new StartElementEvent(config);
                        see.setNameCode(node.getNameCode());
                        see.setTypeCode(node.getTypeAnnotation());
                        see.setLocalNamespaces(node.getDeclaredNamespaces(null));
                        AxisIterator atts = node.iterateAxis(Axis.ATTRIBUTE);
                        while (true) {
                            NodeInfo att = (NodeInfo)atts.next();
                            if (att == null) {
                                break;
                            }
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.