Patent Document ID: 8086959
Application ID: 11326853

Base Claim:
1. A method for inferring a schema from hierarchical data within an electronic document, comprising: in an application program, receiving the electronic document containing the hierarchical eXtensible Markup Language (XML) data and determining from the electronic document that the hierarchical data within the electronic document does not reference a schema, wherein the hierarchical data includes one or more nodes; (a) discovering one of the nodes in the hierarchical data; (b) saving content associated with the discovered node when the node is not determined to be repeating; (c) repeating tasks (a)-(b) until the content for each discovered node has been saved; and generating the schema based on the content saved for each discovered node; wherein generating the schema comprises writing a schema definition for each node that includes specifying a maximum occurrence of repeating nodes that are out of sequence as unbounded by checking for a repeating indicator and a sequence indicator, wherein the schema is an XML schema that provides the XML data a set of grammatical and data type rules that govern types and a structure of data that may be included in the electronic document.

---

Claim 2:
2. The method of claim 1 , wherein saving the content associated with the discovered node comprises: determining whether the discovered node has previously been discovered; if the discovered node has been previously discovered, then storing a first indicator indicating that the node is a repeating node; and examining the content associated with the repeating node and updating a memory location with a data type of the repeating node; and if the discovered node has not been previously discovered, then saving the content associated with the discovered node.