Patent ID: 7519903

Claim:
A converting apparatus, comprising: a document inputting device inputting information of a structured document that is written with a set of hierarchical elements, and composed of a plurality of records each including one text element or more; a joining device calculating a tree structure of a document object model of the structured document, obtaining a list of text elements linked to a text element from the tree structure, obtaining text elements having a same element name successively appear in the list as text elements relatively with a same path from a root among two records or more of the structured document, calculating a hash value for element names of text elements on a route from a root of a subtree to each of the text elements relatively with the same path, and generating a new text element by combining contents of the text elements relatively with the same path to preserve a text relationship between the contents if the text elements relatively with the same path have a same hash value; a generating device generating a new record that includes the new text element and inherits a relative position relationship of text elements in the two records or more; a converting device converting the structured document by replacing the two records or more with the new record, thereby decreasing the number of hierarchical elements of the structured document and preserving text element information of the records; and a document outputting device outputting the structured document after being converted.