Sunday 2 June 2013

Few clarifications about the DOM

Few clarifications about the DOM

I have been trying to understand the DOM and although, I have a fair idea of what it is, there are certain ideas I just cannot pin down. I will list down what I think the DOM is and my questions will be inline.
1.The DOM is a fully object-oriented representation of the web page.The W3C DOM standard forms the basis of the DOM implemented in most modern browsers.
So does the DOM talk about how an XML/HTML document as an object model ?
2.The DOM does not specify that documents must be implemented as a tree or a grove, nor does it specify how the relationships among objects be implemented.
In what other ways can the document be represented ?
3.When you do something like this -
document.write('welcome to my home page!');
The document object is provided by the DOM.The write methods are the interfaces that are exposed to JavaScript by the DOM.
So the objects and it's methods are created as JavaScript objects by the DOM parser and then presented to the JavaScript engine? Or the objects and methods are within the DOM parsing engine in their own native language ? and is exposed to the JavaScript engine ? if this is so then what is responsible for translating from JavaScript to the native language
4.What are language bindings ?
The language binding is the set of objects native to the language in question that implements each of the interfaces in the DOM specification.
Developers can create language bindings from the DOM to their language simply by following the IDL (Interface Definition Language) in the DOM specification.
So if the DOM parsing engine is implemented in say C++, does that mean that when you create language bindings by following the IDL, you are just creating objects in the specific language, i.e C++ that your DOM parsing engine is built with ?

No comments:

Post a Comment