XML and namespaces

Alan Kennedy alanmk at hotmail.com
Wed Dec 7 10:58:42 EST 2005


[Fredrik Lundh]
> It's libxml2 that does all the work, and the libxml2
> authors claim that libxml2 implements the DOM level 2 document model,
> but with a different API.

That statement is meaningless.

The DOM is *only* an API, i.e. an interface. The opening statement on 
the W3C DOM page is

"""
What is the Document Object Model?

The Document Object Model is a platform- and language-neutral interface 
that will allow programs and scripts to dynamically access and update 
the content, structure and style of documents.
"""

http://www.w3.org/DOM/

The interfaces that make up the different levels of the DOM are 
described in CORBA IDL - Interface Definition Language.

DOM Implementations are free to implement the methods and properties of 
the IDL interfaces as they see fit. Some implementations might maintain 
an object model, with separate objects for each node in the tree, 
several string variables associated with each node, i.e. node name, 
namespace, etc. But they could just as easily store those data in 
tables, indexed by some node id. (As an aside, the non-DOM-compatible 
Xalan Table Model does exactly that: 
http://xml.apache.org/xalan-j/dtm.html).

So when the libxml2 developers say (copied from http://www.xmlsoft.org/)

"""
To some extent libxml2 provides support for the following additional 
specifications but doesn't claim to implement them completely:

     * Document Object Model (DOM) 
http://www.w3.org/TR/DOM-Level-2-Core/ the document model, but it 
doesn't implement the API itself, gdome2 does this on top of libxml2
"""

They've completely missed the point: DOM is *only* the API.

> Maybe they're wrong, but wasn't the whole point of this subthread that
> different developers have interpreted the specification in different ways ?

What specification? Libxml2 implements none of the DOM specifications.

-- 
alan kennedy
------------------------------------------------------
email alan:              http://xhaus.com/contact/alan



More information about the Python-list mailing list