Package org.w3c.dom

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


  public void removeRule(RuleModel model) {
    Node rule = this.find("rule", model.getId());

    if (rule != null) {
      Node parent = rule.getParentNode();
      parent.removeChild(rule);

      // now finally save document
      XmlUtils.saveXml(this.getDocument(), this.grammar
          .getCurrentFileName());
    }
View Full Code Here


  public void saveRule(RuleModel model) {
    Node shape = this.find("rule", model.getId());

    if (shape != null) {
      Node parent = shape.getParentNode();
      parent.removeChild(shape);
      parent.appendChild(parent.getOwnerDocument().importNode(
          model.getXml(), true));
    } else {
      this.addRule(model);
    }
View Full Code Here

                    "the same as used while creating an Sequence",
                    listOfNodes.item(i),
                    ((NodeValue) sequence.getItem(i + 1)).asW3CNode());
        }
        // now change NodeList, this should left sequence unchanged
        node.removeChild(nodes[0]);
        assertSame("Removed from list of nodes node isn't exists in sequence",
                nodes[0], ((NodeValue) sequence.getItem(1)).asW3CNode());
    }

    /**
 
View Full Code Here

                                    visibleElem = statusElem.getOwnerDocument().createElementNS(null, "visible");
                                    statusElem.appendChild(visibleElem);
                                }
                                // remove old childs
                                while (visibleElem.hasChildNodes()) {
                                    visibleElem.removeChild(visibleElem.getFirstChild());
                                }
                                visibleElem.appendChild(statusElem.getOwnerDocument().createTextNode("true"));
                            }
                        }
                    }
View Full Code Here

                        NodeList childs = currentProfile.getChildNodes();
                        int      index, max;
                        max = childs.getLength();
                        for(index = max - 1; index >= 0; index--) {
                            if (childs.item(index).getNodeType() == Node.TEXT_NODE) {
                                currentProfile.removeChild(childs.item(index));
                            }
                        }
                        childs = currentDelta.getChildNodes();
                        max = childs.getLength();
                        for(index = 0; index < max; index++) {
View Full Code Here

                for (int i = 0, length = nodes.getLength(); i<length; i++) {
                    Node node = nodes.item(i);
                    Node parent = node.getParentNode();

                    parent.removeChild(node);
                }
            }

            // Test for an attribute that needs to be added to an element
            String name = getAttribute(elem, "add-attribute", replaceProperties);
View Full Code Here

            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }

        incElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                       ToolConstants.SCHEMA_URI,
                                                       "include");
View Full Code Here

            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }

        incElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                          "http://www.w3.org/2001/XMLSchema",
                                                          "include");
View Full Code Here

            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }

        incElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                          "http://www.w3.org/2001/XMLSchema",
                                                          "include");
View Full Code Here

            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }
       
        incElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                       ToolConstants.SCHEMA_URI,
                                                       "include");
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.