Package org.w3c.dom

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


    Node currentNode = m_currentNode;

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

      // System.out.println(newNode.getNodeName());
    }
View Full Code Here


    private void appendTextNode() {
        if (_textBuffer.length() > 0) {
            final Node last = (Node)_nodeStk.peek();
            if (last == _root && _nextSiblingCache != null) {
                _lastSibling = last.insertBefore(_document.createTextNode(_textBuffer.toString()), _nextSiblingCache);
            } else {
               _lastSibling = last.appendChild(_document.createTextNode(_textBuffer.toString()));
             }
             _textBuffer.setLength(0);
         }
View Full Code Here

  Node last = (Node)_nodeStk.peek();
 
  // 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);
View Full Code Here

  final Node last = (Node)_nodeStk.peek();
  ProcessingInstruction pi = _document.createProcessingInstruction(
    target, data);
  if (pi != null){
          if (last == _root && _nextSibling != null)
              last.insertBefore(pi, _nextSibling);
          else
              last.appendChild(pi);
         
          _lastSibling = pi;
        }
View Full Code Here

  appendTextNode();
  final Node last = (Node)_nodeStk.peek();
  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

    Node currentNode = m_currentNode;

    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 (source != null)
      text.setTextSource(source);

    Node parent = getParentNode();
    if (parent != null)
      parent.insertBefore(text, getNextSibling());

    return text;
  }

  /**
 
View Full Code Here

    // normalize IStructuredDocumentRegion
    if (index == 1) {
      setStructuredDocumentRegion(container.getStructuredDocumentRegion(0));
    }

    parent.insertBefore(nextText, getNextSibling());
    return nextText;
  }

  /**
   * Retruns data for the range
View Full Code Here

        resultContainer.setTextContent("Result: ");
        Element resultElt = document.createElement("span");
        resultElt.setAttribute("id", "result");
        resultElt.setIdAttribute("id", true);
        resultContainer.appendChild(resultElt);
        body.insertBefore(resultContainer, body.getFirstChild());

        Element executionLogContainer = document.createElement("div");
        executionLogContainer.setTextContent("Execution Log:");
        Element executionLog = document.createElement("div");
        executionLog.setAttribute("id", "log");
View Full Code Here

                    Element propertyElem = UtilXml.addChildElement(resourceElem, "property", resourceDocument);
                    propertyElem.setAttribute("key", StringEscapeUtils.unescapeHtml(labelInfo.getLabelKey()));
                    if (UtilValidate.isNotEmpty(labelInfo.getLabelKeyComment())) {
                        Comment labelKeyComment = resourceDocument.createComment(StringEscapeUtils.unescapeHtml(labelInfo.getLabelKeyComment()));
                        Node parent = propertyElem.getParentNode();
                        parent.insertBefore(labelKeyComment, propertyElem);
                    }
                    for (String localeFound : localesFound) {
                        LabelValue labelValue = labelInfo.getLabelValue(localeFound);
                        String valueString = null;
                        if (labelValue != null) {
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.