System and method for validating hierarchically-organized messages
First Claim
1. A computer-readable storage medium encoded with computer-executable instructions to perform a method of validating text content structured into a plurality of elements comprised of markup and the content, which is delimited by the mark, the method comprising:
- encountering as part of a depth-first traversal order for encountering the plurality of elements, a first element of the plurality of elements;
consulting one or more validation tables to identify, from among a plurality of validation delegates, a first delegate that corresponds to said first element, the one or more validation tables not being schema that describe valid syntax or structure of said text content, the one or more validation tables including a local validation table and a global validation table, the one or more validation tables including for each element listed in said one or more validation tables, a flag indicating whether subtrees of a given element are to be traversed;
determining that the flag corresponding to said first element indicates that subtrees of said first element are to be traversed;
executing said first delegate with the content of the first element to determine whether the content in the first element is valid;
encountering as part of the depth-first traversal order for encountering the plurality of elements, a second element that is a root of a subtree of said first element;
consulting the one or more validation tables to identify, from among the plurality of validation delegates, a second delegate; and
executing said second delegate with the content of the second element to determine whether the content in the second element is valid,wherein at least one of said first delegate or said second delegate determines whether the content of the element to which it is applied is valid based on at least one non-syntactic condition of the corresponding content.
2 Assignments
0 Petitions
Accused Products
Abstract
A mechanism for validating a message, such as an XML message or other hierarchically-organized content. A validation engine walks through the tree represented by the message preferably in depth-first traversal order. Upon encountering each node in the tree, the validation engine consults a validation table to identify a delegate that is to be invoked. The validation engine then invokes the delegate identified for that node, and calls itself recursively on the subtrees of the current node. After the subtrees have been processed, the validation engine again consults the validation table to identify a post-handler for the current node, and then invokes the post-handler. An entry in the validation table may be flagged as “exclusive” to prevent traversal of subtrees of the node corresponding to that entry. Additionally, there may be both global and local validation tables, where the global table is used when a node has no entry in the local table.
29 Citations
24 Claims
-
1. A computer-readable storage medium encoded with computer-executable instructions to perform a method of validating text content structured into a plurality of elements comprised of markup and the content, which is delimited by the mark, the method comprising:
-
encountering as part of a depth-first traversal order for encountering the plurality of elements, a first element of the plurality of elements; consulting one or more validation tables to identify, from among a plurality of validation delegates, a first delegate that corresponds to said first element, the one or more validation tables not being schema that describe valid syntax or structure of said text content, the one or more validation tables including a local validation table and a global validation table, the one or more validation tables including for each element listed in said one or more validation tables, a flag indicating whether subtrees of a given element are to be traversed; determining that the flag corresponding to said first element indicates that subtrees of said first element are to be traversed; executing said first delegate with the content of the first element to determine whether the content in the first element is valid; encountering as part of the depth-first traversal order for encountering the plurality of elements, a second element that is a root of a subtree of said first element; consulting the one or more validation tables to identify, from among the plurality of validation delegates, a second delegate; and executing said second delegate with the content of the second element to determine whether the content in the second element is valid, wherein at least one of said first delegate or said second delegate determines whether the content of the element to which it is applied is valid based on at least one non-syntactic condition of the corresponding content. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method of validating text content structured into a plurality of elements comprised of markup and the content, which is delimited by the markup, comprising:
-
creating one or more validation delegates, each validation delegate being adapted to determine whether a particular type of element of the text is valid, the one or more validation delegates including an exclusive delegate having exclusive control over validating a specific node and subtrees of the specific node; creating a local validation table that specifies validation delegates specific to a particular class of text; and applying a validation engine to the text, wherein the validation engine, for each of the elements, consults said local validation table to identify, from among the validation delegates specified by the table, a validation delegate to be executed with the element, and executes the identified validation delegate with the content of the element, wherein at least one of the validation delegates determines whether the content of the element with which it is executed is valid based on at least one non-syntactic condition of the content of the element. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
-
16. A computer-readable storage medium having stored thereon a data structure comprising:
-
a plurality of element names, each element name identifying an element within text content that is structured into a plurality of elements comprised of markup and the content, which is delimited by the markup; and for each element name, a corresponding name of a first delegate, each first delegate comprising code that determines whether the element that corresponds to the element name is valid, wherein the first delegate determines whether the element that it is called upon to validate is valid based on at least one non-syntactic condition of the content that corresponds to that element; for each element name, a corresponding name of a second delegate, each second delegate comprising code that executes after the first delegate corresponding to the element name, and any delegates corresponding to a subtree of the element that corresponds to the element name, have been run; and for each element name, a flag indicating whether the first delegate corresponding to the element name is to be applied exclusively to the element corresponding to the element name and to any subtree thereof.
-
-
17. A system for validating text content that comprises a plurality of elements that comprise markup and content, the text content being organized in the form of a tree, the system comprising:
-
a computer-readable storage medium containing a first validation table indicating a plurality of delegates, each delegate corresponding to a name of an element in the tree, wherein at least one of the plurality of delegates is an exclusive delegate having exclusive control over validating a specific node and subtrees of the specific node; and the computer-readable storage medium further containing a validation engine configured to traverse the tree and, for each element encountered in the traversal of the tree, consult the first validation table to identify one of the plurality of delegates that is to be executed with the encountered element, and to execute the identified delegate by invoking the delegate, wherein at least one of the plurality of delegates determines whether the element with which it is executed is valid based on at least one non-syntactic condition. - View Dependent Claims (18, 19, 20, 21)
-
-
22. A computer readable storage medium storing a validation engine that performs a process, the process performed by the validation engine comprising:
-
traversing a structured document to visit elements of the structured document, the elements comprising markup and content that is delimited by the markup, where the markup conforms to a markup language, and where the elements are of various element types; and checking the types of the respective elements when the validation engine visits the elements for validation and using the types to determine which executable validation delegates to execute to validate the contents of the respective elements, where the determining is performed according to mapping information that maps the executable validation delegates to corresponding element types, and where the mapping information can be modified to cause the same validation engine, without modification, to modify which executable validation delegates the validation engine selects for which corresponding element types, the determining further comprising examination of the condition of a flag contained in the mapping information for indicating whether the subtrees of a given element are to be traversed. - View Dependent Claims (23, 24)
-
Specification