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

idom.Document fails to clone

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 7.0.2
    • Fix Version/s: None
    • Component/s: ZK Loader
    • Labels:
    • Environment:

      Windows XP SP3, Java 1.7

      Description

      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);
          }
      }
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: