Patent ID: 7925643
Filing Date: 2011-04-12
Classification: G06F

Abstract:
1. A computer implemented method for encoding an eXtensible Markup Language (XML) document defined by an XML Schema document (XSD), the method executed by a processor comprising: receiving a statistical tree representing the XSD, the statistical tree capturing information defined by the XSD by representing elements, attributes, and enumerations of the XSD as branches, nodes, and leaves of the statistical tree, the statistical tree having a plurality of bits corresponding to nodes of the statistical tree; resetting a plurality of bits representing an encoding of the XML document and setting a current node to a root node of the statistical tree; for each XML fragment of a plurality of XML fragments of the XML document, in an order in which the XML fragments appear within the XML document, as a defined entry point, locating the XML fragment within a node of the statistical tree; determining a sequence of bits corresponding to nodes of a sub-tree within the statistical tree between the current node and the node of the statistical tree that has been located; appending the sequence of the bits to the bits representing the encoding of the XML document; setting the node of the statistical tree that has been located as the current node; and, outputting the bits representing the encoding of the XML document; wherein, for each XML fragment of the plurality of XML fragments of the XML document, in the order in which the XML fragments appear within the XML document, the method further comprises, after appending the sequence of the bits to the bits representing the encoding of the XML document: determining type information of the current node from the statistical tree; where the type information represents a predefined XML type, storing data associated with the predefined XML type; wherein, for each XML fragment of the plurality of XML fragments of the XML document, in the order in which the XML fragments appear within 10 the XML document, the method further comprises, after appending the sequence of the bits to the bits representing the encoding of the XML document: where the type information does not represent a predefined XML type, determining an instance of the type information from a node of the statistical tree; setting the node of the statistical tree from which the instance of the type information has been determined as the current node; and, reentering the method at the defined entry point; wherein, for each XML fragment of the plurality of XML fragments of the XML document, in the order in which the XML fragments appear within the XML document, the method further comprises, after appending the sequence of the bits to the bits representing the encoding of the XML document: optimizing the sub-tree based on the current node being a parent node of the sub-tree; wherein optimizing the sub-tree based on the current node being the parent node of the sub-tree comprises: as a second defined entry point, incrementing a count denoting a number of times the parent node has been found; where the count has reached its maximum number of allowed occurrences, removing the parent node from the sub-tree and adjusting the sub-tree due to removal of the parent node from the sub-tree.