Setting the environment
We need to create an application (XMLDiff) and a project (XMLDiff) in JDeveloper to compare two XML documents. In the project, create the XML documents catalog1.xml
and catalog2.xml
that are to be compared with File|New. In the New Gallery window select Categories|General|XML and Items|XML Document. In the Create XML File window specify the File Name and click on OK. Add a Java class XMLCompare.java to the project with File|New. In the New Gallery window select Categories|General and Items|Java Class. In the Create Java Class window specify the File Name and click on OK. The directory structure of the application to compare two XML documents is shown in the following illustration:
We need to add the Oracle XML Parser v2 library and the C:/Oracle/Middleware/jdeveloper/modules/oracle.xdk_11.1.1/xml.jar
JAR file to the project with Tools|Project Properties. In the Project Properties window select Libraries and Classpath. Select Add Library to add the Oracle XML Parser...