Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-44

Remove Xerces Parser Implementation from API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • simple-odfdom-0.8
    • odfdom-0.8.7
    • java
    • None
    • Operating System: All
      Platform: All
    • 67

    Description

      There is one current dependency of the ODFDOM API to the Xerces parser that is overwhelming (esp. obvious when viewing the JavaDoc).

      Currently all ODF elements and attributes take advantage of the Xerces DOM implementation by inheriting from it.

      Instead the W3C interfaces for attribute, element and document should be implemented and dispatched via composition to the implementation, hiding the implemention.
      The advantage no user might use accidentally Xerces implementation that would be dropped when we change the parser and even more important we have the change to notify ourselves when the DOM implementation is being invoked and are able to do additional actions (important if we might want to keep DOM and DOC layer in synch)..

      There come three classes into my mind that each should implement one of the W3C DOM interfaces:

      org.odftoolkit.odfdom.OdfAttribute
      org.odftoolkit.odfdom.OdfElement
      org.odftoolkit.odfdom.OdfFileDom

      should implement

      http://www.j2ee.me/javase/6/docs/api/org/w3c/dom/Attr.html
      http://www.j2ee.me/javase/6/docs/api/org/w3c/dom/Element.html
      http://www.j2ee.me/javase/6/docs/api/org/w3c/dom/Document.html

      The downside seems to be that instead of one Java object, there are two being referenced. It would be interesting would this means in terms of resource (esp. memory) consumption.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--bug67_umcompleted.patch
          41 kB
          Ying Chun Guo
        2. ASF.LICENSE.NOT.GRANTED--bug67_updateButTestProblems.patch
          2.77 MB
          Svante Schubert
        3. ASF.LICENSE.NOT.GRANTED--bug67.patch
          42 kB
          Ying Chun Guo
        4. ASF.LICENSE.NOT.GRANTED--ProfileOdfdomTest.java
          2 kB
          hans-peter
        5. ASF.LICENSE.NOT.GRANTED--testdom_src.jar
          9 kB
          Ying Chun Guo
        6. ASF.LICENSE.NOT.GRANTED--XmlDocument.java
          88 kB
          Svante Schubert

        Issue Links

          Activity

            People

              svanteschubert@odftoolkit.org Svante Schubert
              svanteschubert@odftoolkit.org Svante Schubert
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: