Package org.w3c.dom

Examples of org.w3c.dom.Element.replaceChild()


        Element root = document.createElementNS(null, "root");
        root.appendChild(document.createElementNS(null, "child"));
        Text node1 = document.createTextNode("test1");
        Text node2 = document.createTextNode("test2");
        try {
            root.replaceChild(node2, node1);
            fail("Expected DOMException");
        } catch (DOMException ex) {
            assertEquals(DOMException.NOT_FOUND_ERR, ex.code);
        }
    }
View Full Code Here


        NodeList list = root.getElementsByTagNameNS (J2SEProjectType.PROJECT_CONFIGURATION_NAMESPACE,MINIMUM_ANT_VERSION_ELEMENT);
        if (list.getLength() == 1) {
            Element me = (Element) list.item(0);
            list = me.getChildNodes();
            if (list.getLength() == 1) {
                me.replaceChild (doc.createTextNode(J2SEProjectGenerator.MINIMUM_ANT_VERSION), list.item(0));
                return root;
            }
        }
        assert false : "Invalid project file"; //NOI18N
        return root;
View Full Code Here

     */
    public final Jx replaceChild(Jx newChildJx, Jx oldChildJx) {
        Element e = e();
        if (e != null && newChildJx.n() != null && oldChildJx.n() != null) {
            e.getOwnerDocument().adoptNode(newChildJx.n());
            e.replaceChild(newChildJx.n(), oldChildJx.n());
        }

        return this;
    }

View Full Code Here

        String valueString = new String(valueText);
      
        String updatedValueString = typeChecker.calculateUpdatedCodeExpression(valueString, moduleName, moduleNameResolver, null, oldName, newName, category, null);
        if (!updatedValueString.equals(valueString)) {
            CDATASection newValueChild = XMLPersistenceHelper.createCDATASection(document, updatedValueString);
            valueChildElem.replaceChild(newValueChild, valueChild);
            changesMade = true;
        }
        return changesMade;
    }
View Full Code Here

     */
    public final Jx replaceChild(Jx newChildJx, Jx oldChildJx) {
        Element e = e();
        if (e != null && newChildJx.n() != null && oldChildJx.n() != null) {
            e.getOwnerDocument().adoptNode(newChildJx.n());
            e.replaceChild(newChildJx.n(), oldChildJx.n());
        }

        return this;
    }

View Full Code Here

      assertEquals(test3, children1.item(2));
      assertEquals(test4, children1.item(3));
      assertEquals(test5, children1.item(4));

      // test replace child
      div.replaceChild(test6, test3);

      // examine children
      NodeList children2 = div.getChildNodes();
      assertEquals(test1, children2.item(0));
      assertEquals(test2, children2.item(1));
View Full Code Here

      fragment.appendChild(test7);
      fragment.appendChild(test8);
      fragment.appendChild(test9);

      // test replace child
      div.replaceChild(fragment, test3);

      // examine children
      NodeList children2 = div.getChildNodes();

      assertEquals(test1, children2.item(0));
View Full Code Here

              if (!(localObject1 instanceof Element))
                continue;
              if (localObject1 != localNode1)
                localElement1.insertBefore(paramHTMLElement, (Node)localObject1);
              else
                localElement1.replaceChild(paramHTMLElement, localNode1);
              return;
            }
            localElement1.appendChild(paramHTMLElement);
          }
          return;
View Full Code Here

        samlDocument.adoptNode(clonedAssertionElement);

        Element parentNode = (Element) originalAssertionElement.getParentNode();

        parentNode.replaceChild(clonedAssertionElement, originalAssertionElement);
    }


    protected Response buildResponse(Document responseDoc) throws ProcessingException, ConfigurationException, IOException {
        String str = buildHtmlPostResponse(responseDoc);
View Full Code Here

                samlDocument.adoptNode(clonedAssertionElement);

                Element parentNode = (Element) originalAssertionElement.getParentNode();

                parentNode.replaceChild(clonedAssertionElement, originalAssertionElement);
            }

            if (!isSignAssertionOnly()) {
                signDocument(samlDocument, keypair, x509Certificate);
            }
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.