Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Labels:
      None
    • Number of attachments :
      0

      Description

      (from mailing list, by guillaume lefebvre)

      I have a problem using DomConverter.

      My test project only depends on :

      • stax2-api-3.0.3.jar
      • staxmate-2.0.0.jar
      • jdk 1.6.0_21

      2 tests :

      • Test 1 that works perfectly

      FileInputStream in = new FileInputStream("demo.xml");
      XMLStreamReader sr = XMLInputFactory.newInstance().createXMLStreamReader(in);
      Document doc = new DOMConverter().buildDocument(sr);
      in.close();

      • Test 2 that throws a HIERARCHY_REQUEST_ERR exception :

      FileInputStream in = new FileInputStream("demo.xml");
      XMLStreamReader sr = XMLInputFactory.newInstance().createXMLStreamReader(in);

      while (sr.hasNext()) {
      switch (sr.getEventType())

      { case XMLStreamReader.START_ELEMENT: Document doc = new DOMConverter().buildDocument(sr); }

      sr.next();
      }
      in.close();

      org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
      at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:391)
      at com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:235)
      at org.codehaus.staxmate.dom.DOMConverter._build(DOMConverter.java:292)
      at org.codehaus.staxmate.dom.DOMConverter.buildDocument(DOMConverter.java:171)
      at org.codehaus.staxmate.dom.DOMConverter.buildDocument(DOMConverter.java:152)
      at org.codehaus.staxmate.dom.DOMConverter.buildDocument(DOMConverter.java:131)
      at com.staxmatetest.Main.main(Main.java:22)

        Activity

        Hide
        Tatu Saloranta added a comment -

        Fixed, will be in 2.0.1.

        Show
        Tatu Saloranta added a comment - Fixed, will be in 2.0.1.

          People

          • Assignee:
            Tatu Saloranta
            Reporter:
            Tatu Saloranta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: