What are the XML related technologies?

The XML specification only stipulates the syntax for XML. Accordingly, the following XML related technologies play an important role in actually using XML:

  • DOM (Document Object Model)
  • SAX (Simple API for XML)

DOM (Document Object Model)
The DOM specification is recommended by the W3C (World Wide Web Consortium), the standards organization for Internet-related technologies.
Under DOM, XML documents and HTML documents are modeled on a tree structure (DOM Tree) when being processed. External applications use this DOM Tree and included nodes (element nodes and attribute nodes, etc.) to perform operations on XML and HTML documents. The DOM specification defines the different "levels" of DOM: the higher the level, the more advanced features it supports. Under the DOM specification, the entire XML document is first loaded into memory, allowing for the easy creation of new nodes, or node movement/ deletion. Saving the last DOM Tree in memory allows for the creation or update of an XML document.
The drawbacks of DOM include the fact that an entire XML document must be analyzed when first constructing the DOM Tree, and the fact that the entire XML document must be loaded into memory. The large the XML document, the greater the overhead in terms of processing and memory used.
SAX (Simple API for XML)
SAX is a specification created through the XML-DEV mailing list, rather than being a W3C-recommended specification. Processing via SAX is light and quick in contrast to DOM. SAX loads an XML document in order from top to bottom, and is an event-driven API that notifies the application of an event regarding information associated with the detection of an element's start tag or end tag, or occurrences of text. On the application side, the event received is processed to acquire the data from within the XML document.
The benefit of SAX is that processing can be conducted while analyzing the XML document-there is no need to load the entire document first as with DOM. On the other hand, not having an API for XML document updating means that any XML document updates have to be handled from within the application. Also, SAX only loads an XML document in order from top to bottom, so forward or backward referencing of XML documents must be performed by the application. SAX is especially suited for searching for and extracting data from XML documents.

1240-357-XML.png
Figure 1. 1240-357-XML.png
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*