Method and apparatus for synchronizing an XML document with its object model
First Claim
1. A method of synchronizing an XML Document Object Model (DOM) with its object model, said method comprising the steps of:
- (1) storing a map of information objects for nodes of said DOM, said information objects comprising information about said nodes needed to transfer changes made to said DOM nodes to corresponding object model objects and changes made to said corresponding object model objects to said DOM nodes;
(2) for each node of said DOM, using said map information objects to create an adapter software module adapted to transfer changes in said DOM node to a corresponding object model object and changes in said corresponding object model object to said DOM node; and
(3) responsive to creation of, or other change in, a DOM node or an object model object, running said corresponding adapter software module to transfer the change to said corresponding other of said DOM node or object model object, whereby changes made in one are reflected to the other without re-parsing an XML document.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for synchronizing an XML document object model with the corresponding object model on the fly and in real time such that changes in either the document object model or the object model can be immediately reflected in the other without re-parsing the XML document. The invention utilizes a series of DOM/object model adapter software modules, each responsible for one (or more) object model properties and document object model nodes, respectively. Each adapter is registered to receive notification of a change in an object model property or DOM node for which it is responsible and updates the corresponding DOM node or object model property, respectively.
-
Citations
31 Claims
-
1. A method of synchronizing an XML Document Object Model (DOM) with its object model, said method comprising the steps of:
-
(1) storing a map of information objects for nodes of said DOM, said information objects comprising information about said nodes needed to transfer changes made to said DOM nodes to corresponding object model objects and changes made to said corresponding object model objects to said DOM nodes;
(2) for each node of said DOM, using said map information objects to create an adapter software module adapted to transfer changes in said DOM node to a corresponding object model object and changes in said corresponding object model object to said DOM node; and
(3) responsive to creation of, or other change in, a DOM node or an object model object, running said corresponding adapter software module to transfer the change to said corresponding other of said DOM node or object model object, whereby changes made in one are reflected to the other without re-parsing an XML document. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
(2.1) creating an adapter corresponding to a node of said DOM;
(2.2) consulting said map for map information objects corresponding to said adapter; and
(2.3) for each map information object that identifies a child adapter to said adapter, creating said child adapter by repeating steps (2.1) and (2.2).
-
-
5. The method of claim 4 wherein said map information objects further comprise primitive objects and further wherein step (3) comprises, for each primitive map information object corresponding to an adapter, transferring said change from said DOM node or said object model object to the other of said object model object or said DOM node.
-
6. The method of claim 5 wherein step (2) further comprises the step of:
(2.4) for each adapter created, registering each said adapter with said corresponding DOM node and said corresponding object model object to receive notifications of changes therein.
-
7. The method of claim 6 wherein step (3) further comprises the steps of:
-
(3.1) receiving notification of a change from a changed DOM node or object model object;
(3.2) running the adapter corresponding to said changed DOM node or object model object;
(3.3) transferring said change from said changed DOM node or said changed object model object to said corresponding object model object to said corresponding DOM node, respectively.
-
-
8. The method of claim 7 wherein step (3.3) comprises the steps of:
-
(3.3.1) if the change in said DOM node or object model object is a removal of said DOM node or object model object, removing said corresponding object model object or DOM node;
(3.3.2) if a map information object corresponding to said changed DOM node or changed object model object does not identify a child adapter and said object model or DOM already contains said corresponding object model object or DOM node, respectively, updating said corresponding object model object or DOM node; and
(3.3.3) if a map information object corresponding to said changed DOM node or changed object model object does not identify a child adapter and said object model or DOM does not already contains said corresponding object model object or DOM node, respectively, creating said corresponding object model object or DOM node.
-
-
9. The method of claim 1 wherein said method is embodied within an XML editor software application.
-
10. The method of claim 1 wherein said object model is a Meta Object Facility object model.
-
11. The method of claim 1 wherein each adapter corresponds to one and only one DOM node.
-
12. The method of claim 1 wherein there is a one to one correspondence per adapter between a DOM node and said corresponding object model object.
-
13. A computer readable product embodied on computer readable media readable by a computing device, said product for synchronizing an XML Document Object Model (DOM) with its object model, said computer program product comprising computer executable instructions for:
-
(1) storing a map of information objects for nodes of said DOM, said information objects comprising information about said nodes needed to transfer changes in said DOM nodes to corresponding object model objects and changes in said corresponding object model objects to said DOM nodes;
(2) for each node of said DOM, using said map information objects to create an adapter software module adapted to transfer changes in said DOM node to a corresponding object model object and changes in said corresponding object model object to said DOM node; and
(3) responsive to creation of, or a change in, a DOM node or an object model object, running said corresponding adapter software module to transfer the creation of, or change in, said corresponding other of said DOM node or object model object, whereby changes made in one are reflected to the other without re-parsing an XML document. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 31)
(2.1) creating an adapter corresponding to a node of said DOM;
(2.2) consulting said map for map information objects corresponding to said adapter; and
(2.3) for each map information object that identifies a child adapter to said adapter, creating said child adapter by repeating steps (2.1) and (2.2) for said child adapter.
-
-
17. The computer readable product of claim 16 wherein said map information objects further comprise primitive objects and further wherein computer executable instructions (3) comprise, for each primitive map information object corresponding to an adapter, transferring said change from said DOM node or said object model object to the other of said object model object or said DOM node.
-
18. The computer readable product of claim 17 wherein computer executable instructions (2) further comprise:
(2.4) for each adapter created, registering each said adapter with said corresponding DOM node and said corresponding object model object to receive notifications of changes therein.
-
19. The computer readable product of claim 18 wherein computer executable instructions (3) further comprise:
-
(3.1) receiving notification of a change from a changed DOM node or object model object;
(3.2) running the adapter corresponding to said changed DOM node or object model object;
(3.3) transferring said change from said changed DOM node or said changed object model object to said corresponding object model object to said corresponding DOM node, respectively.
-
-
20. The computer readable product of claim 19 wherein computer executable instructions (3.3) comprise:
-
(3.3.1) if the change in said DOM node or object model object is a removal of said DOM node or object model object, removing said corresponding object model object or DOM node;
(3.3.2) if a map information object corresponding to said changed DOM node or changed object model object does not identify a child adapter and said object model or DOM already contains said corresponding object model object ro DOM node, respectively, updating said corresponding object model object or DOM node; and
(3.3.3) if a map information object corresponding to said changed DOM node or changed object model object does not identify a child adapter and said object model or DOM does not already contains said corresponding object model object ro DOM node, respectively, creating said corresponding object model object or DOM node.
-
-
21. The computer readable product of claim 13 wherein said forms part of an XML editor software application.
-
22. The computer readable product of claim 21 wherein said object model is a Meta Object Facility object model.
-
31. The method of claim 13 wherein said method is embodied within an XML editor software application.
-
23. A method of synchronizing a source side version of a computer file with its display side version, said method comprising the steps of:
-
(1) storing a map of information objects for portions of said source side version, said information objects comprising information about said source side portions needed to transfer changes in said source side portions to corresponding display side portions and changes in said corresponding display side portions to said source side portions;
(2) for each source side portion, using said map information objects to create an adapter software module adapted to transfer changes in said source side portions to a corresponding display side portion and changes in said corresponding display side portion to said source side portion; and
(3) responsive to creation of, or a change in, a source side portion or a display side portion, running said corresponding adapter software module to transfer the change to said corresponding other of said source side portion or display side portion, whereby changes made in one are reflected to the other. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30)
(2.1) creating an adapter corresponding to a source side portion;
(2.2) consulting said map for map information objects corresponding to said adapter; and
(2.3) for each map information object that identifies a child adapter to said adapter, creating said child adapter by repeating steps (2.1) and (2.2).
-
-
27. The method of claim 26 wherein said map information objects further comprise primitive objects and further wherein step (3) comprises, for each primitive map information object corresponding to an adapter, transferring said change from said source side portion or said display side portion to the other of said display side portion or said source side portion.
-
28. The method of claim 27 wherein step (2) further comprises the step of:
(2.4) for each adapter created, registering each said adapter with said corresponding source side portion and said corresponding display side portion to receive notifications of changes therein.
-
29. The method of claim 28 wherein step (3) further comprises the steps of:
-
(3.1) receiving notification of a change from a changed source side portion or display side portion;
(3.2) running the adapter corresponding to said changed source side portion or display side portion;
(3.3) transferring said change from said changed source side portion or said changed display side portion to said corresponding display side portion or said corresponding source side portion, respectively.
-
-
30. The method of claim 29 wherein step (3.3) comprises the steps of:
-
(3.3.1) if the change in said source side portion or display side portion is a removal of said portion, removing said corresponding portion on the other side;
(3.3.2) if a map information object corresponding to said changed source side portion or said display side portion does not identify a child adapter and said other side portion already contains said corresponding portion, respectively, updating said corresponding portion on the other side; and
(3.3.3) if a map information object corresponding to said changed DOM node or changed object model object does not identify a child adapter and said object model or DOM does not already contains said corresponding object model object ro DOM node, respectively, creating said corresponding portion on the other side.
-
Specification