Package org.w3c.dom

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


   * @return This object as a string serialized XML document.
   * @throws DOMException If we can't create the XML document.
   */
  public String toXML() throws DOMException {
    Document doc = Configuration.createDocument("execServer");
    doc.replaceChild(toXML(doc), doc.getDocumentElement());
    return XML.serialize(doc);
  }

  /** Class name for the ExecServer to execute. */
  private String className;
View Full Code Here


//      doc = builder.newDocument();
      doc = builder.getDOMImplementation().createDocument(null, "Temp", null);

      Node newRoot = doc.getDocumentElement();
      Node importNode = doc.importNode(rootNode, true);
      doc.replaceChild(importNode, newRoot);
    }
    catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    return doc;
View Full Code Here

      wrappingElement.setAttributeNS(XMLNS,
            "xmlns:" + wrappingElementPrefix, wrappingElementQName.getNamespaceURI())
     
      Element encryptedDocRootElement = encryptedDoc.getDocumentElement();
      //Bring in the encrypted wrapping element to wrap the root node
      encryptedDoc.replaceChild(wrappingElement, encryptedDocRootElement);
     
      wrappingElement.appendChild(encryptedDocRootElement);
     
      if (addEncryptedKeyInKeyInfo)
      {
View Full Code Here

      Element dataElement = getNextElementNode(decryptedRoot.getFirstChild());
      if (dataElement == null
         throw new IllegalStateException("Data Element after encryption is null");

      decryptedRoot.removeChild(dataElement);
      decryptedDoc.replaceChild(dataElement, decryptedRoot);
     
      return decryptedDoc.getDocumentElement();
   }
  
   /**
 
View Full Code Here

        }
        wrappingElement.setAttributeNS(XMLNS, "xmlns:" + wrappingElementPrefix, wrappingElementQName.getNamespaceURI());

        Element encryptedDocRootElement = encryptedDoc.getDocumentElement();
        // Bring in the encrypted wrapping element to wrap the root node
        encryptedDoc.replaceChild(wrappingElement, encryptedDocRootElement);

        wrappingElement.appendChild(encryptedDocRootElement);

        if (addEncryptedKeyInKeyInfo) {
            // Outer ds:KeyInfo Element to hold the EncryptionKey
View Full Code Here

        Element dataElement = getNextElementNode(decryptedRoot.getFirstChild());
        if (dataElement == null)
            throw logger.nullValueError("Data Element after encryption is null");

        decryptedRoot.removeChild(dataElement);
        decryptedDoc.replaceChild(dataElement, decryptedRoot);

        return decryptedDoc.getDocumentElement();
    }

    /**
 
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.