Comparing XML documents with the XMLDiff class
You use the XMLDiff
class in the oracle.xml.differ
package to compare two XML documents. The class contains methods to compare two XML documents and enumerate the differences between them. In addition, you can choose to generate an XSLT stylesheet consisting of the differences between the two XML documents. You can then use the stylesheet to convert one of the compared XML documents into the other. This section compares an example XML document named catalog1.xml
with another XML document called catalog2.xml. Catalog1.xml
is listed as follows:
<?xml version="1.0" encoding="windows-1252" ?> <catalog> <journal title="Oracle Magazine" publisher="Oracle Publishing" edition="September-October 2008"> <article section="FEATURES"> <title>Share 2.0</title> <author>Alan Joch</author> </article> </journal> <journal title="Oracle Magazine" publisher="Oracle Publishing" edition="September-October...