Package net.sf.saxon.om

Examples of net.sf.saxon.om.NodeInfo


     * @return an iterator over the results of the expression
     * @deprecated since 8.9 - use {@link #iterate}
     */

    public SequenceIterator rawIterator(Source source) throws XPathException {
        NodeInfo origin;
        if (source instanceof NodeInfo) {
            origin = (NodeInfo)source;
        } else {
            origin = evaluator.getConfiguration().buildDocument(source);
        }
View Full Code Here


    }

    public void validate() throws XPathException {
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLWithParam || child instanceof XSLFallback) {
                // OK;
            } else if (child.getNodeKind() == Type.TEXT) {
                    // with xml:space=preserve, white space nodes may still be there
                if (!Whitespace.isWhite(child.getStringValueCS())) {
                    compileError("No character data is allowed within xsl:next-match", "XTSE0010");
                }
            } else {
                compileError("Child element " + child.getDisplayName() +
                        " is not allowed within xsl:next-match", "XTSE0010");
            }
        }

    }
View Full Code Here

    /**
    * Evaluate in a general context
    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        NodeInfo start = (NodeInfo)argument[0].evaluateItem(c);
        if (start==null) {
            return null;
        }
        return start.getRoot();
    }
View Full Code Here

    /**
    * Evaluate in a general context
    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        NodeInfo target;
        if (argument.length > 1) {
            target = (NodeInfo)argument[1].evaluateItem(c);
        } else {
            Item current = c.getContextItem();
            if (current==null) {
View Full Code Here

    * @param target the target node
    */

    public static boolean isLang(String arglang, NodeInfo target) {
        String doclang = null;
        NodeInfo node = target;

        while(node!=null) {
            doclang = node.getAttributeValue(StandardNames.XML_LANG);
            if (doclang!=null) {
                break;
            }
            node = node.getParent();
            if (node==null) {
                return false;
            }
        }

View Full Code Here

     * not well-formed, this returns the first element child of the root if there is one, otherwise
     * null.
     */

    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

     protected static NodeList getElementsByTagName(NodeInfo node, String tagname) {
         AxisIterator allElements = node.iterateAxis(Axis.DESCENDANT);
         List<Node> nodes = new ArrayList<Node>(100);
         while(true) {
             NodeInfo next = (NodeInfo)allElements.next();
             if (next == null) {
                 break;
             }
             if (next.getNodeKind()==Type.ELEMENT) {
                 if (tagname.equals("*") || tagname.equals(next.getDisplayName())) {
                     nodes.add(NodeOverNodeInfo.wrap(next));
                 }
             }
         }
         return new DOMNodeList(nodes);
View Full Code Here

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

    public void validate() throws XPathException {
        //checkWithinTemplate();
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLWithParam) {
                // OK;
            } else if (child.getNodeKind() == Type.TEXT) {
                    // with xml:space=preserve, white space nodes may still be there
                if (!Whitespace.isWhite(child.getStringValueCS())) {
                    compileError("No character data is allowed within xsl:apply-imports", "XTSE0010");
                }
            } else {
                compileError("Child element " + child.getDisplayName() +
                        " is not allowed within xsl:apply-imports", "XTSE0010");
            }
        }
    }
View Full Code Here

     * @return the root of the tree that is currently being built, or that has been most recently built
     *         using this builder
     */

    public NodeInfo getCurrentRoot() {
        NodeInfo physicalRoot = currentRoot;
        if (physicalRoot instanceof DocumentImpl && ((DocumentImpl)physicalRoot).isImaginary()) {
            return ((DocumentImpl)physicalRoot).getDocumentElement();
        } else {
            return physicalRoot;
        }
View Full Code Here

TOP

Related Classes of net.sf.saxon.om.NodeInfo

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.