Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
simple-odfdom-0.8
-
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
Attachments
Issue Links
- is depended upon by
-
ODFTOOLKIT-34 Assigning shape objects the adequate style:family (graphic/presentation)
- Open
-
ODFTOOLKIT-45 Provide only allowed newChildElement methods dependent on attribute value
- Open
-
ODFTOOLKIT-46 Use composition instead of inheritance between DOM and DOC level
- Closed