Package net.sf.saxon.om

Examples of net.sf.saxon.om.AxisIterator


        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 = StringValue.EMPTY_STRING;
                } else {
                    if (this instanceof XSLParam) {
                        if (!requiredParam) {
                            if (Cardinality.allowsZero(requiredType.getCardinality())) {
                                select = EmptySequence.getInstance();
                            } else {
                                requiredParam = true;
                            }
                        }
                    } else {
                        if (Cardinality.allowsZero(requiredType.getCardinality())) {
                            select = EmptySequence.getInstance();
                        } else {
                            compileError("Default value () is not valid for the declared type");
                        }
                    }
                }
            } 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


        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");
View Full Code Here

            for (int i = 0; i < characterMapElements.size(); i++) {
                XSLCharacterMap charmap = (XSLCharacterMap) characterMapElements.get(i);
                charmap.assemble(map);
            }
        }
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            Item child = kids.next();
            if (child == null) {
                return;
            }
            XSLOutputCharacter oc = (XSLOutputCharacter)child;
            map.put(new Integer(oc.getCodePoint()), oc.getReplacementString());
View Full Code Here

    public void validate() throws TransformerConfigurationException {
        if (select!=null && hasChildNodes()) {
            compileError("An " + getDisplayName() + " element with a select attribute must be empty");
        }
        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 = 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 StringValue(first.getStringValue());
                    //} else if (first instanceof XSLValueOf) {
View Full Code Here

    public void validate() throws TransformerConfigurationException {
        checkWithinTemplate();

        // 2.0 spec has reverted to the 1.0 rule that xsl:text may not have child elements
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while(true) {
            Item child = kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof StyleElement) {
                compileError("xsl:text may not contain child elements");
View Full Code Here

        // Collect names of columns to be added

        StringBuffer statement = new StringBuffer(120);
        statement.append("INSERT INTO " + table + " (");

        AxisIterator kids = iterateAxis(Axis.CHILD);
        NodeInfo child;
    int cols = 0;
    while (true) {
            child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
        if (child instanceof SQLColumn) {
          if (cols++ > 0statement.append(',');
View Full Code Here

    }

    public List getColumnInstructions(Executable exec) throws XPathException {
        List list = new ArrayList(10);

        AxisIterator kids = iterateAxis(Axis.CHILD);
        NodeInfo child;
    while (true) {
            child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
        if (child instanceof SQLColumn) {
          list.add(((SQLColumn)child).compile(exec));
View Full Code Here

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

            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);
         ArrayList nodes = new ArrayList(100);
         while(true) {
             NodeInfo next = (NodeInfo)allElements.next();
             if (next == null) {
                 break;
             }
             if (next.getNodeKind()==Type.ELEMENT) {
                 if (tagname.equals("*") || tagname.equals(next.getDisplayName())) {
View Full Code Here

         return getElementsByTagNameNS(node, namespaceURI, localName);
     }

     public static NodeList getElementsByTagNameNS(NodeInfo node, String namespaceURI, String localName) {
         String ns = (namespaceURI==null ? "" : namespaceURI);
         AxisIterator allElements = node.iterateAxis(Axis.DESCENDANT);
         ArrayList nodes = new ArrayList(100);
         while(true) {
             NodeInfo next = (NodeInfo)allElements.next();
             if (next == null) {
                 break;
             }
             if (next.getNodeKind()==Type.ELEMENT) {
                 if ((ns.equals("*") || ns.equals(next.getURI())) &&
View Full Code Here

TOP

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