Package org.w3c.dom

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


        }
        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

                    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

      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

        if (last != document) {
            final String text = new String(ch, start, length);
            if (lastSibling != null && lastSibling.getNodeType() == Node.TEXT_NODE) {
                ((Text)lastSibling).appendData(text);
            } else if (last == root && nextSibling != null) {
                lastSibling = last.insertBefore(document.createTextNode(text), nextSibling);
            } else {
                lastSibling = last.appendChild(document.createTextNode(text));
            }

        }
View Full Code Here

        Node last = 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
View Full Code Here

    public void processingInstruction(String target, String data) {
        final Node last = 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

    public void comment(char[] ch, int start, int length) {
        final Node last = 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

                if (comment != null
                    && comment.getTextContent().endsWith(OGNLUtils.SOAPUI_CLONE_COMMENT)) {
                    Node parent = instance.getParentNode();
                    if (parent != null) {
                        Comment newComment = parent.getOwnerDocument().createComment(comment.getTextContent());
                        parent.insertBefore(newComment, instance);
                    }
                }
            }

            NodeList children = template.getChildNodes();
View Full Code Here

            clone.setAttributeNS(OGNLUtils.JBOSSESB_SOAP_NS, OGNLUtils.JBOSSESB_SOAP_NS_PREFIX + IS_CLONE_ATTRIB, "true");
            clone.setAttributeNS(OGNLUtils.JBOSSESB_SOAP_NS, OGNLUtils.JBOSSESB_SOAP_NS_PREFIX + OGNLUtils.OGNL_ATTRIB, ognl + "[" + Integer.toString(i + 1) + "]");
            if (insertPoint == null) {
                parent.appendChild(clone);
            } else {
                parent.insertBefore(clone, insertPoint);
            }
            //The clones can have collections too, so we need to expand them here
            expandChildren(clone, params);
        }
    }
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.