Package org.w3c.dom

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


        Element fragElt = (Element) _contextDocument.importNode(
             d.getDocumentElement(), true);
        result = _contextDocument.createDocumentFragment();
        Node child = fragElt.getFirstChild();
        while (child != null) {
          fragElt.removeChild(child);
          result.appendChild(child);
          child = fragElt.getFirstChild();
        }
        // String outp = serialize(d);
View Full Code Here


      if (this._state == MODE_SIGN) {
         Element digestValueElement =XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                 Constants._TAG_DIGESTVALUE,0);
         Node n=digestValueElement.getFirstChild();
         while (n!=null) {
               digestValueElement.removeChild(n);
               n = n.getNextSibling();
         }

         String base64codedValue = Base64.encode(digestValue);
         Text t = this._doc.createTextNode(base64codedValue);
View Full Code Here

      if (this._state == MODE_SIGN) {
         Element signatureValueElem = XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                                         Constants._TAG_SIGNATUREVALUE,0);
         while (signatureValueElem.hasChildNodes()) {
            signatureValueElem.removeChild(signatureValueElem.getFirstChild());
         }

         String base64codedValue = Base64.encode(bytes);

         if (base64codedValue.length() > 76) {
View Full Code Here

      orderElement.setAttribute("job_chain", jobChain);
      NodeList orderChildren = orderElement.getChildNodes();
      for (int i = 0; i < orderChildren.getLength(); i++) {
        Node child = orderChildren.item(i);
        if (child.getNodeName().equals("run_time")) {
          orderElement.removeChild(child);
        }
      }

      StringWriter out = new StringWriter();
      OutputFormat format = new OutputFormat(orderDoc);
View Full Code Here

            for(int i = 0; i < list.getLength(); i++) {
                // check the Node's text context for a match with mbeanName
                if(list.item(i).getTextContent().equals(mbeanName)) {
                    // remove the node from rootElement
                    Node toRemoveNode = list.item(i);
                    rootElement.removeChild(toRemoveNode);
                    break;
                }
            }
            // save the document
            saveDocument(doc, pathToXML);
View Full Code Here

                        Element el = (Element)nd;
                        if (local.equals(nd.getLocalName())) {
                            setChild(el, false);
                            nd = el.getFirstChild();
                            while (nd != null) {
                                el.removeChild(nd);
                                nd = el.getFirstChild();
                            }
                            return;
                        }
                    }
View Full Code Here

    protected void runTest() throws Throwable {
        DocumentBuilder builder = dbf.newDocumentBuilder();
        Element element = builder.parse(new InputSource(new StringReader(
                "<root><a/><b/><c/></root>"))).getDocumentElement();
        element.removeChild(element.getFirstChild());
        Node firstChild = element.getFirstChild();
        assertNotNull(firstChild);
        assertEquals("b", firstChild.getNodeName());
    }
}
View Full Code Here

            wsSign.build(
                doc, null, assertion, crypto, "16c73ab6-b892-458f-abf5-2f875f74882e",
                "security", secHeader
            );
        Element assertionElement = (Element)assertion.getElement().cloneNode(true);
        assertionElement.removeChild(assertionElement.getFirstChild());
        secHeader.getSecurityHeader().appendChild(assertionElement);

        if (LOG.isDebugEnabled()) {
            LOG.debug("SAML 1.1 Authn Assertion (sender vouches):");
            String outputString =
View Full Code Here

        int n = attrs.getLength();
        for (int i=0; i<n; i++) {
            root.setAttributeNode((Attr)attrs.item(i));
        }

        root.removeChild(realRoot);
    }

    /**
     * Extracts the first XSL processing instruction from the input
     * XML document.
View Full Code Here

            }

            // Remove all but the first Text node
            for (Iterator it = textNodes.iterator(); it.hasNext();)
            {
                elem.removeChild((org.w3c.dom.Node) it.next());
            }
            return result;
        }
    }
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.