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


                    Node parent = node.getParentNode();
                    while ( index >= 0 ) {
                        node.setNodeValue(value.substring(0, index+2));
                        value = value.substring(index +2);
                        node = fDocument.createCDATASection(value);
                        parent.insertBefore(node, node.getNextSibling());
                        index = value.indexOf("]]>");
                    }
                }
                break;
            }
View Full Code Here

        }
        Text currentNode = null;
      if (isReadOnly()){
            Text newNode = this.ownerDocument().createTextNode(content);
            if (parent !=null) { // check if node in the tree               
                parent.insertBefore(newNode, this);
                parent.removeChild(this);
                currentNode = newNode;
            } else {
                return newNode;
            }
View Full Code Here

      setNodeValue(data.substring(0, offset));

        // insert new text node
        Node parentNode = getParentNode();
      if (parentNode != null) {
        parentNode.insertBefore(newText, nextSibling);
        }

      return newText;

    } // splitText(int):Text
View Full Code Here

     @param  newNode  <code>Node</code> to insert.
     */
    protected void insertNode(Node oldNode, Node newNode) {
        Node clonedNode = XmlUtil.deepClone(oldNode, newNode);
        Node parent = oldNode.getParentNode();
        parent.insertBefore(clonedNode, oldNode);
    }


    /**
     *  Replace <code>Element</code>.
View Full Code Here

            orgCell.removeAttribute(
              OfficeConstants.ATTRIBUTE_TABLE_NUM_COLUMNS_REPEATED);
        }

        Node parentNode = orgCell.getParentNode();
        parentNode.insertBefore(splitCell, orgCell);

        return splitCell;
    }

View Full Code Here

      args[0] = args[0].substring(1);
      Node nn = element.cloneNode(true);
      NamedNodeMap attr = nn.getAttributes();
      attr.removeNamedItem(name);
      Node parent = element.getParentNode();
      parent.insertBefore(nn, element);
    }
   
    String v;
    NamedNodeMap attr = element.getAttributes();
View Full Code Here

    Text middleText = getModel().getDocument().createTextNode(middle);

    // case 1: normal one
    if (!isEmptyString(before) && !isEmptyString(tail)) {
      Node parent = textNode.getParentNode();
      parent.insertBefore(
          getModel().getDocument().createTextNode(before), textNode);
      Element bnode = createStyleElement();
      bnode.appendChild(middleText);
      parent.insertBefore(bnode, textNode);
      textNode.setNodeValue(tail);
View Full Code Here

      Node parent = textNode.getParentNode();
      parent.insertBefore(
          getModel().getDocument().createTextNode(before), textNode);
      Element bnode = createStyleElement();
      bnode.appendChild(middleText);
      parent.insertBefore(bnode, textNode);
      textNode.setNodeValue(tail);
    }

    if (isEmptyString(before) && !isEmptyString(tail)) {
      Node sibling = textNode.getPreviousSibling();
View Full Code Here

      if (sibling != null
          && sibling.getNodeName().equalsIgnoreCase(getTag())) {
        sibling.appendChild(middleText);
      } else {
        Node parent = textNode.getParentNode();
        parent.insertBefore(getModel().getDocument().createTextNode(
            before), textNode);
        Element bnode = createStyleElement();
        bnode.appendChild(middleText);
        parent.insertBefore(bnode, textNode);
      }
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.