# US 10,372,809 B2 · Validating an XML document

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,372,809 B2
- Document ID: US10372809B2
- Status: Granted
- Kind: B2
- Application number: 14/830,491
- Filed: 2015-08-19
- Published: 2015-12-10
- Granted: 2019-08-06
- Earliest claimed: 2008-07-24
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Timothy J. Baldwin; Duncan G. Clark; Xin Peng Liu; Xi Ning Wang; Liang Xue; Yu Chen Zhou
- Web page: https://patentgrep.com/patent/US10372809B2

## CPC

- G06F 40/143: Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
- G06F 40/18: of spreadsheets (form-filling G06F40/174)
- G06F 40/226: Validation
- G06F 16/258: {Data format conversion from or to a database}
- G06F 16/86: {Mapping to a database}
- G06F 16/9577: {Optimising the visualization of content, e.g. distillation of HTML documents}
- G06F 40/154: Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
- G06F 40/166: Editing, e.g. inserting or deleting
- G06F 40/221: Parsing markup language streams (streaming G06F40/149)
- G06F 40/55: Rule-based translation
- G06Q 10/06: Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q 10/10: Office automation; Time management
- G16C 20/70: Machine learning, data mining or chemometrics
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G16C: COMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE

## Abstract

At least one XML document to be validated is parsed, and XML data in the at least one XML document is represented as data objects in at least one data object model in a memory. At least one rule document is parsed and a rule object model that includes rule objects is created in the memory. At least part of the data objects are extracted from the at least one data object model and at least part of rule objects are extracted from the rule object model. Partial validation is performed in a corresponding execution context that validates the extracted at least part of the data objects based upon the extracted at least part of the rule objects.

## Claims

### Claim 1

A method for validating an XML document, comprising:
parsing at least one XML document to be validated and representing XML data in the at least one XML document as data objects in at least one data object model in a memory;
parsing at least one rule document and representing rule data parsed from the at least one rule document as scoped rule objects in a rule object model in the memory;
extracting part of the data objects from the at least one data object model and extracting part of the scoped rule objects from the rule object model; and
performing a partial validation in a corresponding execution context that supports a fail-fast implementation, of the extracted part of the data objects based upon a scope specified by the extracted part of the scoped rule objects.

### Claim 2 (depends on 1)

The method according to claim 1, where the part of the scoped rule objects are extracted from the rule object model according to predefined rule extraction criteria.

### Claim 3 (depends on 1)

The method according to claim 1, where the part of the data objects are extracted from the data object model according to predefined data extraction criteria.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
generating an execution context for at least one scoped rule object of the extracted part of the scoped rule objects according to a predefined function, registering the execution context to a context registry, and performing validation of the at least one scoped rule object in the execution context.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising extracting the part of the scoped rule objects from the rule object model and the part of the data objects from the data object model according to a predefined function.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising stopping the partial validation in response to a fail-fast rule of the fail-fast implementation being triggered.

### Claim 7 (depends on 1)

The method according to claim 1, where the at least one rule document comprises at least one Schematron document and the scoped rule objects in the rule object model maintain a hierarchical relationship within the memory corresponding to elements in the at least one Schematron document.

### Claim 8 (depends on 1)

The method according to claim 1, where each element in the at least one XML document is mapped to a data object in the at least one data object model and the data objects maintain a hierarchical relationship within the memory corresponding to the elements in the at least one XML document.

### Claim 9 (depends on 1)

The method of claim 1, where the at least one rule document comprises at least one Schematron document, and the scope specified by the extracted part of the scoped rule objects comprises a subset of a phase element of the Schematron document.

### Claim 10

A computer program product comprising a non-transitory computer readable storage medium including a computer readable program code, where the computer readable program code when executed on a computer causes the computer to:
parse at least one XML document to be validated and to represent XML data in the at least one XML document as data objects in at least one data object model in a memory;
parse at least one rule document and represent rule data parsed from the at least one rule document as scoped rule objects in a rule object model in the memory;
extract part of the data objects from the at least one data object model and extract part of the scoped rule objects from the rule object model; and
perform a partial validation in a corresponding execution context that supports a fail-fast implementation, of the extracted part of the data objects based upon a scope specified by the extracted part of the scoped rule objects.

### Claim 11 (depends on 10)

The computer program product of claim 10, where the computer readable program code when executed on the computer further causes the computer to extract the part of the scoped rule objects from the rule object model according to predefined rule extraction criteria.

### Claim 12 (depends on 11)

The computer program product of claim 11, where the computer program product is in the form of a computer system, with the computer program product further comprising:
a processor(s) set structured, programmed, and/or connected to execute the computer readable program code stored in the non-transitory computer readable storage medium.

### Claim 13 (depends on 10)

The computer program product of claim 10, where the computer readable program code when executed on the computer further causes the computer to extract the part of the data objects from the data object model according to predefined data extraction criteria.

### Claim 14 (depends on 10)

The computer program product of claim 10, where the computer readable program code when executed on the computer further causes the computer to:
generate an execution context for at least one scoped rule object of the extracted part of the scoped rule objects according to a predefined function, register the execution context to a context registry, and perform validation of the at least scoped one rule object in the execution context.

### Claim 15 (depends on 14)

The computer program product of claim 14, where the computer program product is in the form of a computer system, with the computer program product further comprising:
a processor(s) set structured, programmed, and/or connected to execute the computer readable program code stored in the non-transitory computer readable storage medium.

### Claim 16 (depends on 10)

The computer program product of claim 10, where the computer readable program code when executed on the computer further causes the computer to extract the part of the scoped rule objects from the rule object model and the part of the data objects from the data object model according to a predefined function.

### Claim 17 (depends on 10)

The computer program product of claim 10, where the computer readable program code when executed on the computer further causes the computer to stop the partial validation in response to a fail-fast rule of the fail-fast implementation being triggered.

### Claim 18 (depends on 10)

The computer program product of claim 10, where the at least one rule document comprises at least one Schematron document, and the scoped rule objects in the rule object model maintain a hierarchical relationship within the memory corresponding to elements in the at least one Schematron document.

### Claim 19 (depends on 10)

The computer program product of claim 10, where each element in the at least one XML document is mapped to a data object in the at least one data object model, and the data objects maintain a hierarchical relationship within the memory corresponding to the elements in the at least one XML document.

### Claim 20 (depends on 10)

The computer program product of claim 10, where the computer program product is in the form of a computer system, with the computer program product further comprising:
a processor(s) set structured, programmed, and/or connected to execute the computer readable program code stored in the non-transitory computer readable storage medium.

### Claim 21

A method comprising:
receiving a schematron data set including information indicative of a plurality of rules, and with each given rule of the plurality of rules including: (i) rule logic data reflecting substance of the given rule, and (ii) rule context data reflecting a context in which the given rule is applicable;
receiving an XML instance document including information indicative of a plurality of instantiated contexts;
selecting a selected subset of rules of the plurality of rules with each rule of the selected subset of rules having the rule context data reflecting the context that matches one of the plurality of instantiated contexts of the XML instance document;
sharing the selected subset of rules; and
performing rule matching on the XML instance document using the selected subset of rules, comprising performing a partial validation that supports a fail-fast implementation of the XML instance document using the selected subset of rules.

### Claim 22 (depends on 21)

The method of claim 21, where sharing the selected subset of rules comprises sharing a subset of the rule context data of the plurality of rules.

### Claim 23 (depends on 21)

The method of claim 21, where selecting the selected subset of rules of the plurality of rules comprises directly selecting the selected subset of rules from the schematron data set.

### Claim 24 (depends on 21)

A computer readable storage medium storing instructions which, when executed on one or more programmed processors, carry out the method according to claim 21, where the computer readable storage medium is not a transitory signal per se.
