XML 2003 logo

DOM Implementation Challenges: Design Perspective

Abstract

The DOM is arguably a flexible, powerful and most popular API for manipulating XML in use today. Nevertheless, there are certain issues, which you need to be aware of before you go ahead with an application relating to DOM interface implementation.

This session will focus on sharing the key challenges experienced during the design & implementation of DOM interface for QuarkXPress, which is the leading publishing software by Quark Inc. and is used by more than three million customers around the world. It provides all the tools required to create, design, and deliver high-impact publications in both print and electronic media.

By developing a DOM interface for QuarkXPress, we create a common methodology for developers of navigating, extracting, and setting content and attributes stored within QuarkXPress.

The Implementation

The prerequisite for any application to support DOM interface is to provide a hierarchical structure to its document. A schema was created for QuarkXPress using XML Schema Definition Language (XSD).

The next step was implementation of DOM APIs as per W3C specs. These APIs internally call native application functions to add, delete or access QuarkXPress' document structure. Xerces, an XML Parser by apache.org, was used for creation and maintenance of the DOM tree.

The implementation allows for users to create, delete and access all of the nodes in the QuarkXPress document structure.

The Challenges

1. How to handle change of the document structure/schema on the fly i.e. element types get added/deleted at run time?

2. DOM is suited to model a document and not an application. What happens to App's UI constructs such as menus and dialogs, which are not tied to a document?

3. How to perform actions such as 'print', 'spell check' on the document through DOM API?

4. DOM, being an XML based API, caters to textual input and output data. What if I wish to pass binary data such as pictures?

5. My APIs are not type safe since everything is a DOMString. Do I have to sacrifice type safety?

6. How can I pass/retrieve OS objects such as font, port through DOM APIs? Well, they don't belong to the document.

7. DOM events, they are too many if you follow the spec. If 10 attributes of a box are modified, will I receive 10 separate events while I just needed one? How does it affect performance?

8. How to represent inter dependencies among elements/attributes of the schema? E.g. there's no way in XSD to say that attrib 'a' of element 'Ea' is available only if attrib 'b' of element 'Ea' is set to true?

Keywords

»DOM.

1. Product Presentation Paper

Since this was a product presentation, no paper was prepared for the proceedings.

Biography

Project Lead R&D
»Mohali, Punjab

Manisha is the Project Lead R&D, XML Technology Group at Quark India (www.quark.com). In a career spanning seven years, she has been instrumental in design and development of various XML related applications based on C/C++ on platforms such as Windows and Macintosh. After graduating in Computer Science Engineering in 1996, Manisha joined Tata Infotech Ltd. where she worked on system software development. Her interest in publishing product development moved her into Quark Inc. who is a leading developer of tools and technologies for desktop, workgroup, and enterprise publishing. Quark has been providing award-winning software for professional publishers since its flagship product QuarkXPress changed the course of traditional publishing.At Quark, Manisha plays the lead role in formulating Quark's XML strategy and is responsible for specs formulation, design and development of software required for realizing XML workflow in Publishing Houses such as Pearson. With the latest version of QuarkXPress 6.0, she delivered a set of XML enhancements to the two most successful and well known XPress' XML XTensions, XML Import XT and Avenue which import and export XML data to and from QuarkXPress respectively. She is currently engaged in providing a DOM interface to QuarkXPress, by way of which XPress' XTension developers would be able program on XPress through an XML based API. The new interface poses great challenges in terms of its ability to replace the earlier one, which is being used since more than a decade now by millions of XTension developers.