Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2317

idom.Document fails to clone

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 7.0.2
    • ZK Loader
    • Windows XP SP3, Java 1.7

      When clone is called in org.zkoss.idom.Document it fails with error "org.zkoss.idom.DOMException: Hierarchy request error: Only one root element is allowed, when adding [Element: <zk/>]." I believe the error occurs because the root element of the cloned document is not cleared before the assignment of the cloned children.

      public class DocumentTest {
      
          @Test
          public void testCloning() throws ParserConfigurationException, SAXException, IOException {
              Document doc = new SAXBuilder(true, false, true).build(new StringReader("<zk><window/></zk>"));
              Document clone = (Document) doc.clone();
              Assert.assertNotNull(clone);
          }
      }
      

            Unassigned Unassigned
            benji benji
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: