Patent ID: 7185277

Claim:
A method for merging a source document into a destination document to create a merged document, wherein the source document or the destination document or both contain one or more markup language tags having a start tag or an end tag or both a start tag and an end tag, the method comprising: comparing the source document and the destination document to identify one or more matching blocks and one or more difference blocks; splitting all matching blocks that contain a markup language tag for which only a start tag or an end tag has been matched so that the matched markup language tags are no longer matched; splitting all matching blocks that contain a markup language tag for which either the start tag or the end tag has been matched to a different tag in the other document so that the matched markup language tags are no longer matched; splitting any matching blocks containing markup language tags that would create overlapping tags when merged; and merging the matching and difference blocks so that all markup language tags contained in the merged document are well formed by: copying, for each matching block, text from one of the following: the source document and the destination document, in the matching block into the merged document, copying, for each difference block, the text from one of the following: the source document and the destination document, in the difference block into the merged document if the difference block respectively contains text only from one of the following: the source document and the destination document, and copying, for each difference block, the text from the source document and the destination document in the difference block into the merged document if the difference block contains text from both the source document and the destination document wherein the text from the source document is copied to a first section of the merged document and the text from the destination document is copied to a second section of the merged document.