摘要 |
A method and system for comparing two documents, such as XML (Extensible Markup Language) files, where each document is capable of being parsed into a DOM (Document Object Model) trees. Each tree structure is converted into an array of leaf paths containing nodes. These arrays are then compared to identify corresponding matched nodes-either exactly matched nodes or schema matched nodes. In reporting the results of the comparison, unmatched nodes of the source document are reported as "deleted nodes", that is, existing in the source but not in the target. Similarly all unmatched nodes of the target document are reported as "added nodes", that is, existing in the target but not in the source. In addition, schema matched nodes are reported as "modified nodes"between source and target documents.
|