Package org.w3c.dom.traversal

Examples of org.w3c.dom.traversal.NodeIterator


     * @return
     * @throws TransformerException
     */
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
            }
View Full Code Here


        return new ClassPathXmlApplicationContext("org/servicemix/components/jaxws/jaxws-in.xml");
    }

    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
            }
View Full Code Here

        return content;
    }
   
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
            }
View Full Code Here

     * @return
     * @throws TransformerException
     */
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
        Node root = iterator.nextNode();
        if (root instanceof Element) {
            Element element = (Element) root;
            if (element == null) {
                return "";
            }
View Full Code Here

      }
         
          // Create NodeIterators for both the "empty" and "input" instance documents
          // NOTE: must have DOM level 2 to allow DocumentTraversal.
          DocumentTraversal traversableS = (DocumentTraversal) instanceS;
          NodeIterator iteratorS = traversableS.createNodeIterator(instanceS, NodeFilter.SHOW_ALL, null, true);
         
          // Iterate over the input instance data
          Node nodeS;
          Node nodeI;
          boolean found = false;
         
          while ((nodeS = iteratorS.nextNode()) != null) {
             
              if (nodeS.getNodeName().compareTo(root) != 0) { // ignore root element
               
                  DocumentTraversal traversableI = (DocumentTraversal) instanceI;
                  NodeIterator iteratorI = traversableI.createNodeIterator(instanceI, NodeFilter.SHOW_ELEMENT, null, true);
                 
                  // reset flag
                  if (found == true) {
                      found = false;
                  }
                 
                  while (((nodeI = iteratorI.nextNode()) != null) && (found == false)) {
                   
                      // if the nodeName for this instance node matches an elements attribute in the schema,
                      // overwrite the text value of that node with the text from this node
                    // then delete the node from the original instance so that it can't be copied again.
                      if (nodeI.getNodeName().compareTo(nodeS.getNodeName()) == 0) {
View Full Code Here

           String fmsg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {getTypeString(m_resultType)});                       
       throw new XPathException(XPathException.TYPE_ERR,fmsg); // Can not convert {0} to a single node. This getter applies to types
                                                                 // ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE.
      }
 
    NodeIterator result = null;
    try {
      result = m_resultObj.nodeset();
    } catch (TransformerException te) {
      throw new XPathException(XPathException.TYPE_ERR,te.getMessage());
    }
       
        if (null == result) return null;
       
        Node node = result.nextNode();
        
        // Wrap "namespace node" in an XPathNamespace
        if (isNamespaceNode(node)) {
            return new XPathNamespaceImpl(node);
        } else {
View Full Code Here

          Node contextNode, String str, Node namespaceNode)
            throws TransformerException
  {

    // Have the XObject return its result as a NodeSetDTM.
    NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);

    // Return the first node, or null
    return nl.nextNode();
  }
View Full Code Here

          Node contextNode, String str, Node namespaceNode)
            throws TransformerException
  {

    // Have the XObject return its result as a NodeSetDTM.
    NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);

    // Return the first node, or null
    return nl.nextNode();
  }
View Full Code Here

        throws DOMException {
        if (root == null) {
            throw doc.createDOMException
                (DOMException.NOT_SUPPORTED_ERR, "null.root"null);
        }
        NodeIterator result = new DOMNodeIterator(doc, root, whatToShow,
                                                  filter,
                                                  entityReferenceExpansion);
        if (iterators == null) {
            iterators = new LinkedList();
        }
View Full Code Here

          Node contextNode, String str, Node namespaceNode)
            throws TransformerException
  {

    // Have the XObject return its result as a NodeSetDTM.
    NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode);

    // Return the first node, or null
    return nl.nextNode();
  }
View Full Code Here

TOP

Related Classes of org.w3c.dom.traversal.NodeIterator

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.