# US 2016/0239475 A1 · Adaptive parsing of sparse xml data

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

- Number: US 2016/0239475 A1
- Document ID: US20160239475A1
- Status: Published application
- Kind: A1
- Application number: 15/137,678
- Filed: 2016-04-25
- Published: 2016-08-18
- Earliest claimed: 2008-04-02
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: THOMAS BITONTI; DANA PRICE; WENDELL BOUKNIGHT, JR.
- Web page: https://patentgrep.com/patent/US20160239475A1

## CPC

- G06F 40/143: Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
- G06F 16/81: Indexing, e.g. XML tags; Data structures therefor; Storage structures
- G06F 16/84: Mapping; Conversion
- G06F 40/146: Coding or compression of tree-structured data
- G06F 40/221: Parsing markup language streams (streaming G06F40/149)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for representing and generating XML data are provided. An associated system includes one or more processors and a mapping module configured to execute upon the one or more processors. The mapping module is configured to map each sparsely-encoded XML element of a sparse representation of a document into a complete, valid XML document. The system also includes a defaulting module configured to execute upon the one or more processors. The defaulting module is configured to generate at least one XML element that is missing in the sparse representation but required to generate the complete, valid XML document.

## Claims

### Claim 1

A computer-implemented method for representing and generating XML data, the method comprising:
receiving a sparse representation document failing to satisfy a predefined schema, the sparse representation document comprising at least one sparsely-encoded XML element comprising valid XML code portions that are limited to defining attribute values without corresponding tags;
parsing the sparse representation document according to a predefined set of XML parsing rules, wherein the parsing generates a XML document having a valid XML structure according to the predefined schema; and
responsive to encountering the at least one sparsely-encoded XML element during the parsing, applying a mapping function to the at least one sparsely-encoded XML element, wherein the mapping function maps the at least one sparsely-encoded XML element to a nested location in the XML document, and wherein the mapping function utilizes a heuristic.

### Claim 2 (depends on 1)

The method of claim 1, further comprising generating at least one other XML element defining attribute values required for the XML document.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating the at least one other XML element comprises defaulting attribute values per attribute according to a data type specified by the predefined schema.

### Claim 4 (depends on 1)

The method of claim 1, wherein the nested location is a location within a subtree of the XML document that corresponds to a subtree of the sparse representation document in which at least one sparsely-encoded XML element is located.

### Claim 5 (depends on 1)

The method of claim 1, wherein the nested location is determined by user-specified rule.

### Claim 6 (depends on 5)

The method of claim 5, further comprising identifying an appropriate user-specified rule among a plurality of user-specified rules based upon a context of the at least one sparsely-encoded XML element.

### Claim 7 (depends on 1)

The method of claim 1, wherein the heuristic handles at least one mapping by selecting a most recently encountered element.

### Claim 8 (depends on 1)

The method of claim 1, wherein the mapping function uses a combination of elements to determine a unique nesting structure.

### Claim 9

A system for representing and generating XML data, the system comprising:
at least one processor; and
a computer-readable medium having stored thereon a plurality of instructions for causing the at least one processor to perform steps of:
receiving a sparse representation document failing to satisfy a predefined schema, the sparse representation document comprising at least one sparsely-encoded XML element comprising valid XML code portions that are limited to defining attribute values without corresponding tags;
parsing the sparse representation document according to a predefined set of XML parsing rules, wherein the parsing generates a XML document having a valid XML structure according to the predefined schema; and
responsive to encountering the at least one sparsely-encoded XML element during the parsing, applying a mapping function to the at least one sparsely-encoded XML element, wherein the mapping function is configured to map the at least one sparsely-encoded XML element to a nested location in the XML document, and wherein the mapping function is further configured to utilize a heuristic to handle at least one mapping.

### Claim 10 (depends on 9)

The system of claim 9, wherein the plurality of instructions cause the at least one processor to perform a further step of generating at least one other XML element defining attribute values required for the XML document.

### Claim 11 (depends on 9)

The system of claim 9, wherein the nested location is a location within a subtree of the XML document that corresponds to a subtree of the sparse representation document in which the at least one sparsely-encoded XML element is located.

### Claim 12 (depends on 9)

The system of claim 9, wherein the nested location is determined by user-specified rule.

### Claim 13 (depends on 9)

The system of claim 9, wherein the heuristic handles the least one mapping by selecting a most recently encountered element.

### Claim 14 (depends on 9)

The system of claim 9, wherein the mapping function is further configured to use a combination of elements to determine a unique nesting structure.

### Claim 15

A computer-readable storage medium in which is embedded computer-readable code that when loaded on a computer causes the computer to perform steps of:
receiving a sparse representation document failing to satisfy a predefined schema, the sparse representation document comprising at least one sparsely-encoded XML element comprising valid XML code portions that are limited to defining attribute values without corresponding tags;
parsing the sparse representation document according to a predefined set of XML parsing rules, wherein the parsing generates a XML document having a valid XML structure according to the predefined schema; and
responsive to encountering the at least one sparsely-encoded XML element during the parsing, applying a mapping function to the at least one sparsely-encoded XML element, wherein the mapping function is configured to map the at least one sparsely-encoded XML element to a nested location in the XML document, and wherein the mapping function is further configured to utilize a heuristic to handle at least one mapping.

### Claim 16 (depends on 15)

The computer-readable storage medium of claim 15, wherein the computer-readable code causes the computer to further perform a step of generating at least one other XML element defining attribute values required for the XML document.

### Claim 17 (depends on 15)

The computer-readable storage medium of claim 15, wherein the nested location is a location within a subtree of the XML document that corresponds to a subtree of the sparse representation document in which the at least one sparsely-encoded XML element is located.

### Claim 18 (depends on 15)

The computer-readable storage medium of claim 15, wherein the nested location is determined by user-specified rule.

### Claim 19 (depends on 15)

The computer-readable storage medium of claim 15, wherein the heuristic handles the at least one mapping by selecting a most recently encountered element.

### Claim 20 (depends on 15)

The computer-readable storage medium of claim 15, wherein the mapping function is further configured to use a combination of elements to determine a unique nesting structure.
