Patent ID: 7437374

Claim:
A computer-based method for validating a fragment of an XML document, said computer-based method implemented in computer readable program code, said computer readable program code stored in computer memory, said computer-based method comprising steps of: (a) receiving as input a fragment of an XML document into a runtime validation engine; (b) outputting a validation pass message based on an LR parsing technique as follows: (i) obtaining a first token from said fragment of said XML document, (ii) determining whether said first token is of element type said fragment of said XML document that is to be validated against, and if so, (iii) obtaining next token from said fragment of said XML document, (iv) checking whether said next token signifies end of said fragment of said structured document, and if so, identifying a FOLLOW token from a type-mapping table for said element type in (b)(ii); based on said FOLLOW token, performing a low level validation using a generic XML parser and performing a high level validation using an XML schema validation parser; and returning a validation pass if both validations of said generic XML parser and XML schema validation parser are successful and an annotated automaton encoding (AAE) stack is empty; and if said next token does not signify end of said fragment of said XML document, continuing validation as in validating an entire XML document, and when successfully validated as in an entire XML document, returning to step (iii) until end of said XML document token is received and outputting a validation pass when AAE stack is empty.