Tuesday, February 24, 2009

Bug 243799 - Analysis I

It takes a long time to make a second post in regard to Bug 243799. From now on, I will escalate my progress on investigating the bug and post my progress accordingly. Frankly as working on the bug in the past few days, I find out that the bug itself is so complicated. A complicated bug means I can learn more things from it.

At this time, I comprehend what causes the bug but I do not find a good way to fix it.

Let me go through this bug and explain what causes the bug

The description of the bug
We have two xml schema files (test1.xsd and test2.xsd) in a eclipse editor. When we include one of the schema files(test1.xsd) into the another schema file(test2.xsd), all the elements and attributes in the schema (test1.xsd) supposes to be included by the test2.xsd. It only works for one time when I intially include test1.xsd into test2.xsd.
Assuming that test2.xsd includes test1.xsd, if we modify or add some elements and attributes in the test1.xsd and all the elements and attributes in the test2.xsd must be modify or add because test2.xsd contains test1.xsd. The bug is that the elements in the test2.xsd is not responding as the elements in test1.xsd is changing from obersving the user interface.

Before we continue on, let us get concepts
The Document Object Model (DOM) is a platform- and language-independent standard object model for representing HTML or XML documents as well as an Application Programming Interface (API) for querying, traversing and manipulating such documents. (http://en.wikipedia.org/wiki/Document_Object_Model)

What is org.w3c.dom.Node ?
The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised. (http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/Node.html)

IDOMNode implements the interfaces IndexedRegion and org.w3c.dom.Node (See Diagram Below)

IDOMModel implement the interface IStructuredModel. Dom Node List constructs IDOMDocument and IDODocument constructs IDOMModel. (See Diagram Below)

IDOMNode can add or append childNode

Make a big picture

TestSchema2.xsd itself is a IDOMNode

To be continue in Bug 243799 - Analysis II .....................

If my concept is wrong, please point it out so I can correct it