Package org.w3c.dom.traversal

Examples of org.w3c.dom.traversal.NodeIterator.nextNode()


    NodeIterator it = tr.createNodeIterator(
        element, NodeFilter.FILTER_ACCEPT,
        new InputFilter(), false);
    Element e;
    String[] ns = dexter.namespaces();
    while((e = (Element)it.nextNode()) != null) {
      NamedNodeMap attr = e.getAttributes();
      if(! usesNamespace(attr,ns)) {
        Node nn = attr.getNamedItem("name");
        if(nn == null) {
          System.err.println("WARNING: form element has no name");
View Full Code Here


      NodeIterator nit = traversal.createNodeIterator(impl,
            NodeFilter.FILTER_ACCEPT, new PathNodeFilter(path), false);

      int counter = 0;
      while (nit.nextNode() != null)
      {
        ++counter;
      }
      System.out.println("found " + counter + " nodes for path " + args[1]);
View Full Code Here

      int removedSelNum = removed != null ? removed.length : 0;
      int addedSelNum = added != null ? added.length : 0;

      NodeIterator iter = ((DocumentTraversal) doc).createNodeIterator(doc, NodeFilter.SHOW_ELEMENT, null, true);
      Node node;
      while ((node = iter.nextNode()) != null) {
        if (node.getNodeType() == Node.ELEMENT_NODE) {
          Element elm = (Element) node;
          boolean match = false;
          int i;
          for (i = 0; i < removedSelNum && !match; i++) {
View Full Code Here

    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      if (tagName != null) {
        ElementImpl element = (ElementImpl) node;
View Full Code Here

    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      if (tagName != null) {
        ElementImpl element = (ElementImpl) node;
        if (!element.matchTagName(tagName))
View Full Code Here

    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      if (tagName != null) {
        ElementImpl element = (ElementImpl) node;
        if (!element.matchTagName(tagName))
View Full Code Here

    }
    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      ElementImpl element = (ElementImpl) node;
      if (tagName != null) {
View Full Code Here

    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      ElementImpl element = (ElementImpl) node;
      if (tagName != null) {
        String localName = element.getLocalName();
View Full Code Here

    if (tagName.length() == 1 && tagName.charAt(0) == '*') {
      tagName = null; // do not care
    }

    it.nextNode(); // skip the first node since it is the root from createNodeIterator
    for (Node node = it.nextNode(); node != null; node = it.nextNode()) {
      if (node.getNodeType() != ELEMENT_NODE)
        continue;
      ElementImpl element = (ElementImpl) node;
      if (tagName != null) {
        String localName = element.getLocalName();
View Full Code Here

            XObject result = cachedXPathAPI.eval(doc, xpath);
            if (result.bool())
              return true;
            else {
              NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc, xpath);
              return (iterator.nextNode() != null);
            }

        } catch (Throwable e) {
            return false;
        }
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.