Examples of AxisIterator


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

    public void validate(Declaration decl) throws XPathException {
        name = typeCheck(name);
        select = typeCheck(select);
        int countChildren = 0;
        NodeInfo firstChild = null;
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLFallback) {
                continue;
View Full Code Here

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

    public void postValidate() throws XPathException {
        checkAgainstRequiredType(requiredType);

        if (select==null && allowsValue()) {
            textonly = true;
            AxisIterator kids = iterateAxis(Axis.CHILD);
            NodeInfo first = (NodeInfo)kids.next();
            if (first == null) {
                if (requiredType == null) {
                    select = new StringLiteral(StringValue.EMPTY_STRING);
                } else {
                    if (this instanceof XSLParam) {
                        if (!requiredParam) {
                            if (Cardinality.allowsZero(requiredType.getCardinality())) {
                                select = Literal.makeEmptySequence();
                            } else {
                                // The implicit default value () is not valid for the required type, so
                                // it is treated as if there is no default
                                implicitlyRequiredParam = true;
                            }
                        }
                    } else {
                        if (Cardinality.allowsZero(requiredType.getCardinality())) {
                            select = Literal.makeEmptySequence();
                        } else {
                            compileError("The implicit value () is not valid for the declared type", "XTTE0570");
                        }
                    }
                }
            } else {
                if (kids.next() == null) {
                    // there is exactly one child node
                    if (first.getNodeKind() == Type.TEXT) {
                        // it is a text node: optimize for this case
                        constantText = first.getStringValue();
                    }
View Full Code Here

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

        checkTopLevel(null);

        // check that the only children are xsl:output-character elements

        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            Item child = kids.next();
            if (child == null) {
                break;
            }
            if (!(child instanceof XSLOutputCharacter)) {
                compileError("Only xsl:output-character is allowed within xsl:character-map", "XTSE0010");
View Full Code Here

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

        checkTopLevel(null);

        stackFrameMap = new SlotManager();

        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            Item child = kids.next();
            if (child == null) {
                break;
            }
            if (!(child instanceof XSLAttribute)) {
                compileError("Only xsl:attribute is allowed within xsl:attribute-set", "XTSE0010");
View Full Code Here

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

                if (nsuri.equals("")) {
                    parts[0] = "";
                } else if (parts[0].equals("")) {
                    // Need to choose an arbitrary prefix
                    // First see if the requested namespace is declared in the stylesheet
                    AxisIterator iter = iterateAxis(Axis.NAMESPACE);
                    while (true) {
                        NodeInfo ns = (NodeInfo)iter.next();
                        if (ns == null) {
                            break;
                        }
                        if (ns.getStringValue().equals(nsuri)) {
                            parts[0] = ns.getLocalPart();
View Full Code Here

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

        boolean foundNonImport = false;
        topLevel = new ArrayList<Declaration>(50);
        minImportPrecedence = precedence;
        StyleElement previousElement = sourceElement;

        AxisIterator kids = sourceElement.iterateAxis(Axis.CHILD);

        while (true) {
            NodeInfo child = (NodeInfo) kids.next();
            if (child == null) {
                break;
            }
            if (child.getNodeKind() == Type.TEXT) {
                // in an embedded stylesheet, white space nodes may still be there
View Full Code Here

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

     * the document in advance checking for xml:space attributes than to look for them every time
     * we hit a whitespace text node.
     */

    private static boolean findPreserveSpace(DocumentInfo doc) {
        AxisIterator iter = doc.iterateAxis(Axis.DESCENDANT, NodeKindTest.ELEMENT);
        while (true) {
            NodeInfo node = (NodeInfo)iter.next();
            if (node == null) {
                return false;
            }
            String val = Navigator.getAttributeValue(node, NamespaceConstant.XML, "space");
            if ("preserve".equals(val)) {
View Full Code Here

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

    public void validate(Declaration decl) throws XPathException {
        if (select != null && hasChildNodes()) {
            String errorCode = getErrorCodeForSelectPlusContent();
            compileError("An " + getDisplayName() + " element with a select attribute must be empty", errorCode);
        }
        AxisIterator kids = iterateAxis(Axis.CHILD);
        NodeInfo first = (NodeInfo)kids.next();
        if (select == null) {
            if (first == null) {
                // there are no child nodes and no select attribute
                //stringValue = "";
                select = new StringLiteral(StringValue.EMPTY_STRING);
            } else {
                if (kids.next() == null) {
                    // there is exactly one child node
                    if (first.getNodeKind() == Type.TEXT) {
                        // it is a text node: optimize for this case
                        select = new StringLiteral(first.getStringValue());
                    }
View Full Code Here

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

          return;
        }
        // need to determine whether HTML, XHTML or neither so as to control case of node names
        // and distinguish other XML/HTML behaviours - like SelectID
        try {
            AxisIterator iter = this.iterateAxis(Axis.CHILD);
            while (true) {
                NodeInfo n = (NodeInfo)iter.next();
                if (n == null) {
                  break;
                } else if (n.getNodeKind() == Type.ELEMENT) {
//                  String uri = n.getURI();
//                  if (uri != null && uri.length() > 0) {
View Full Code Here

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

      } else {
            if (idIndex != null) {
                return idIndex.get(id);
            } else {
                idIndex = new HashMap();
                AxisIterator iter = iterateAxis(Axis.DESCENDANT, NodeKindTest.ELEMENT);
                boolean useNS = isNSok(node);
                while (true) {
                    NodeInfo node = (NodeInfo)iter.next();
                    if (node == null) {
                        break;
                    }
                    Node testNode = (Node)((HTMLNodeWrapper)node).getUnderlyingNode();
                    String xmlId = (useNS)? getXmlIdNS(testNode) : getXmlId(testNode);
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.