Class DOMCloner

  • Direct Known Subclasses:
    SVGCloneVisible

    public class DOMCloner
    extends java.lang.Object
    Class for cloning XML document, with filter capabilites
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Constructor Summary

      Constructors 
      Constructor Description
      DOMCloner()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.w3c.dom.Document cloneDocument​(org.w3c.dom.DOMImplementation domImpl, org.w3c.dom.Document document)
      Deep-clone a document.
      org.w3c.dom.Node cloneNode​(org.w3c.dom.Document doc, org.w3c.dom.Node eold)
      Clone an existing node.
      void copyAttributes​(org.w3c.dom.Document doc, org.w3c.dom.Element eold, org.w3c.dom.Element enew)
      Copy the attributes from an existing node to a new node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DOMCloner

        public DOMCloner()
    • Method Detail

      • cloneDocument

        public org.w3c.dom.Document cloneDocument​(org.w3c.dom.DOMImplementation domImpl,
                                                  org.w3c.dom.Document document)
        Deep-clone a document.
        Parameters:
        domImpl - DOM implementation to use
        document - Original document
        Returns:
        Cloned document
      • cloneNode

        public org.w3c.dom.Node cloneNode​(org.w3c.dom.Document doc,
                                          org.w3c.dom.Node eold)
        Clone an existing node.
        Parameters:
        doc - Document
        eold - Existing node
        Returns:
        Cloned node
      • copyAttributes

        public void copyAttributes​(org.w3c.dom.Document doc,
                                   org.w3c.dom.Element eold,
                                   org.w3c.dom.Element enew)
        Copy the attributes from an existing node to a new node.
        Parameters:
        doc - Target document
        eold - Existing node
        enew - Target node