Package org.w3c.dom

Examples of org.w3c.dom.Node.appendChild()


            }
            else if (last == _root && _nextSibling != null) {
                _lastSibling = last.insertBefore(_document.createTextNode(text), _nextSibling);
            }
            else {
                _lastSibling = last.appendChild(_document.createTextNode(text));
            }
           
        }
    }
View Full Code Here


  // If the SAX2DOM is created with a non-null next sibling node,
  // insert the result nodes before the next sibling under the root.
  if (last == _root && _nextSibling != null)
      last.insertBefore(tmp, _nextSibling);
  else
      last.appendChild(tmp);

  // Push this node onto stack
  _nodeStk.push(tmp);
  _lastSibling = null;
    }
View Full Code Here

    target, data);
  if (pi != null){
          if (last == _root && _nextSibling != null)
              last.insertBefore(pi, _nextSibling);
          else
              last.appendChild(pi);
         
          _lastSibling = pi;
        }
    }
View Full Code Here

  Comment comment = _document.createComment(new String(ch,start,length));
  if (comment != null){
          if (last == _root && _nextSibling != null)
              last.insertBefore(comment, _nextSibling);
          else
              last.appendChild(comment);
         
          _lastSibling = comment;
        }
    }
View Full Code Here

    if (null != currentNode)
    {
      if (currentNode == m_root && m_nextSibling != null)
        currentNode.insertBefore(newNode, m_nextSibling);
      else
        currentNode.appendChild(newNode);

      // System.out.println(newNode.getNodeName());
    }
    else if (null != m_docFrag)
    {
View Full Code Here

      if (bodyNode != null || headNode != null) {
        // We have either a head or body so put fragment into HTML tag
        Node root = document.appendChild(document.createElement("html"));
        if (headNode != null && bodyNode == null) {
          fragment.removeChild(headNode);
          root.appendChild(headNode);
          Node body = root.appendChild(document.createElement("body"));
          body.appendChild(fragment);
        } else {
          root.appendChild(fragment);
        }
View Full Code Here

        Node root = document.appendChild(document.createElement("html"));
        if (headNode != null && bodyNode == null) {
          fragment.removeChild(headNode);
          root.appendChild(headNode);
          Node body = root.appendChild(document.createElement("body"));
          body.appendChild(fragment);
        } else {
          root.appendChild(fragment);
        }
      } else {
        // No head or body so put fragment into a body
View Full Code Here

        }
      } else {
        // No head or body so put fragment into a body
        Node root = document.appendChild(document.createElement("html"));
        Node body = root.appendChild(document.createElement("body"));
        body.appendChild(fragment);
      }
    }
  }

  private static class DefaultSerializerProvider implements Provider<HtmlSerializer> {
View Full Code Here

            if (deep) {
                for (Node n = importedNode.getFirstChild();
                     n != null;
                     n = n.getNextSibling()) {
                    result.appendChild(importNode(n, true));
                }
            }

            return result;
        }
View Full Code Here

                case XMLStreamConstants.START_ELEMENT:
                    QName name = reader.getName();
                    Element child = createElement(document, name);

                    // push the new element and make it the current one
                    current.appendChild(child);
                    current = child;

                    int count = reader.getNamespaceCount();
                    for (int i = 0; i < count; i++) {
                        String prefix = reader.getNamespacePrefix(i);
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.