A method for processing a Document Object Model (DOM) tree to verify context between multiple related XML tags. One or more of these related XML tags are custom tags. According to the invention, contextual relationships between the related XML tags are verified using the DOM itself to indicate state. In a preferred embodiment, the inventive method begins during the processing of the DOM tree with a current element being processed replacing itself with a placeholder element. The placeholder element includes attributes indicating its state. If a clean-up element does not already exist for the element being processed, the current element creates a clean-up element and adds it to the DOM, for example, as a child node to the root position. When the clean-up element is later encountered, this element scans the entire DOM for all the related tags (now placeholders) of interest. The clean-up element loads the state information from each and processes the state information accordingly. When complete, the clean-up element removes itself from the DOM.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for processing a Document Object Model (DOM), comprising the steps of: replacing a current element being processed in the DOM with a placeholder element including attributes indicating a state of the current element; adding a clean-up element to the DOM in a given position; upon later encountering the clean-up element, processing state information from a set of elements; and thereafter, removing the clean-up element from the DOM.
2. The method as described in claim 1 wherein the given position is a child node of a root position.
3. The method as described in claim 1 further including the step of determining whether any other clean-up element exists in the DOM prior to adding the clean-up element to the DOM in the given position.
4. The method as described in claim 3 wherein the clean-up element is added to the DOM only if no other clean-up elements exist.
5. The method as described in claim 1 wherein the DOM is a data structure comprising a tree.
6. The method as described in claim 5 wherein the DOM conforms to a Document Type Definition(DTD).
7. The method as described in claim 5 wherein the DOM includes at least one custom tag.
8. The method as described in claim 5 wherein the DOM is XML-compliant.
9. A method for processing an XML Document Object Model (DOM) tree, comprising the steps of: replacing each of a set of given tag elements in the DOM tree with a placeholder element including attributes indicating a state of the given tag element; adding a clean-up element to the DOM tree in a given position; upon later encountering the clean-up element, processing state information from a set of related tag elements; and thereafter, removing the clean-up element from the DOM tree.
10. The method as described in claim 8 wherein each of the set of given tag elements have a given contextual relationship.
11. The method as described in claim 9 wherein the given position is a child node of a root position.
12. The method as described in claim 9 further including the step of determining whether any other clean-up element exists in the DOM tree prior to adding the clean-up element to the DOM tree in the given position.
13. The method as described in claim 12 wherein the clean-up element is added to the DOM tree only if no other clean-up elements exist.
14. The method as described in claim 9 wherein the DOM tree conforms to a given Document Type Definition(DTD).
15. The method as described in claim 9 wherein the given tag elements are custom tags.
16. A computer program product in a computer-readable medium for processing a Document Object Model (DOM) tree, comprising: means for replacing a current element being processed in the DOM tree with a placeholder element including attributes indicating a state of the current element; means for adding a clean-up element to the DOM tree in a given position; means operative upon later encountering the clean-up element for processing state information from a set of elements; and means responsive to completion of the processing for removing the clean-up element from the DOM tree.
17. The computer program product as described in claim 16 wherein the current element is a custom tag.
18. The computer program product as described in claim 16 wherein the given position is a child node of a root position.
19. The computer program product as described in claim 16 further including means for determining whether a clean-up element already exists in the DOM tree.
20. The computer program product as described in claim 16 wherein the set of elements have a given contextual relationship.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
September 30, 1999
April 6, 2004
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.