US 7,596,748 B2
Method for validating a document conforming to a first schema with respect to a second schema
Mukund Raghavachari, Baldwin Place, N.Y. (US); and Oded Shmueli, Nofit (Israel)
Assigned to International Business Machines Corporation, Armonk, N.Y. (US)
Filed on Sep. 12, 2003, as Appl. No. 10/662,799.
Prior Publication US 2005/0060645 A1, Mar. 17, 2005
Int. Cl. G06F 17/30 (2006.01)
U.S. Cl. 715—237  [715/234; 715/239] 20 Claims
OG exemplary drawing
 
1. A computer-implemented method for determining compliance between a source document structured in accordance with a source schema and a target schema, the method comprising steps of:
receiving a source schema description and a target schema description;
receiving the source document, wherein the source document comprises an ordered tree structure with labeled elements;
identifying all corresponding element types in the source and target schemas for grouping the corresponding element types into element type pairs, wherein the element type is an indication of the content of an element, and wherein the element type further comprises an element tag name for XML schema if the source schema is XML schema;
classifying each element type pair, according to their relationship, into one of a group consisting of: matching, disjointed, and intersecting;
confirming compliance of the source document if it is determined that all element type pairs corresponding to root elements of the source document are classified as matching; and
confirming non-compliance of the source document according to the target schema if it is determined that at least one element type pair corresponding to a root element of the source document is classified as disjointed; and further:
if it is determined that at least one element type pair corresponding to the root element is classified as intersecting, performing steps of:
identifying a subtree of the source document beginning with a topmost element of the source document, the subtree corresponding to the at least one element type pair classified as intersecting;
classifying the topmost element type pair into one of a group consisting of: matching, disjointed, and intersecting;
confirming compliance of the source document if it is determined that the topmost element type pair is classified as matching; and
confirming non-compliance of the source document if it is determined that the topmost element type pair is classified as disjointed; and further:
if it is determined that the topmost element type pair is classified as intersecting, performing steps of:
identifying a current child element pair of the topmost element type pair from the subtree, wherein the current child element pair comprises an element type pair from the source schema and an element type pair from the target schema;
classifying the current child element pair into one of a group consisting of: matching, disjointed, and intersecting;
confirming non-compliance of the source document if the current child element pair is classified as disjointed;
processing a next child element pair from the subtree if the current child element pair is classified as matching, wherein the processing step further comprises comparing element pairs; and
identifying the next child element pair from the subtree as the topmost element pair if the next child element pair does not belong to a same parent node as the current child element pair.