com.a7soft.examxml
Class ExamXML

java.lang.Object
  extended by com.a7soft.examxml.ExamXML

public class ExamXML
extends java.lang.Object

The main class of the JExamXML application.

This application can be used in two different ways:

1. As a java standalone application

java -jar jexamxml.jar <arguments>

java -classpath "jexamxml.jar" com.a7soft.examxml.ExamXML <arguments>

2. As a jar library, integrated into user's own java application.

To do this jexamxml.jar should be included in the application classpath and the import statement should be used:

import com.a7soft.examxml.ExamXML;

The ExamXML class contains several static method which can be used within java code.

To compare XML files and print differences to delta xml file

ExamXML.compareXMLFiles(String file1,String file2,String delta,String options);

To compare XML files without printing differences, just to determine if two XML files are equal

ExamXML.compareXMLFiles(String file1,String file2);

To compare strings representing XML entities

ExamXML.compareXMLEntities(String entity1, String entity2);
User: Yuri Kernogo Date: July 29, 2007 Time: 12:48:53 PM.

Version:
$Id: ExamXML.java,v 1.11 2007/11/05 09:18:11 Yuri Kernogo Exp $

Method Summary
static int compareXMLEntities(java.lang.String entity1, java.lang.String entity2)
          Compares two XML entities, represented by two String objects and returns a result of comparison.
static int compareXMLFiles(java.lang.String file1, java.lang.String file2)
          Compares two XML files and returns a result of comparison.
static int compareXMLFiles(java.lang.String file1, java.lang.String file2, java.lang.String delta, java.lang.String options)
          Compares two XML files, prints the delta XML file containing differences between them, and returns a result of comparison.
static java.lang.String compareXMLString(java.lang.String entity1, java.lang.String entity2)
          Compares two XML entities, represented by two String objects and returns the String, which contains the differences between XML entities.
static void main(java.lang.String[] argv)
          A main method of the ExamXML class.
static void setLogFile(java.lang.String logFileName)
          Sets the log file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compareXMLString

public static java.lang.String compareXMLString(java.lang.String entity1,
                                                java.lang.String entity2)
Compares two XML entities, represented by two String objects and returns the String, which contains the differences between XML entities.

Parameters:
entity1 - the String object, represents the first XML entity to compare
entity2 - the String object, represents the second XML entity to compare
Returns:
the String object, which contains the differences

compareXMLEntities

public static int compareXMLEntities(java.lang.String entity1,
                                     java.lang.String entity2)
Compares two XML entities, represented by two String objects and returns a result of comparison.

Parameters:
entity1 - the String object representing the first XML entity to compare
entity2 - the String object representing the second XML entity to compare
Returns:
  • the value 0 if two XML entities are equal;
  • the value 1 if two XML entities are not equal;
  • the value 2 if the error(s) occur

compareXMLFiles

public static int compareXMLFiles(java.lang.String file1,
                                  java.lang.String file2)
Compares two XML files and returns a result of comparison. This method does not print differences to the delta XML file.

Parameters:
file1 - the first XML file to compare
file2 - the second XML file to compare
Returns:
  • the value 0 if two XML files are equal;
  • the value 1 if two XML filees are not equal;
  • the value 2 if the error(s) occur

compareXMLFiles

public static int compareXMLFiles(java.lang.String file1,
                                  java.lang.String file2,
                                  java.lang.String delta,
                                  java.lang.String options)
Compares two XML files, prints the delta XML file containing differences between them, and returns a result of comparison.

Parameters:
file1 - the first XML file to compare
file2 - the second XML file to compare
delta - the delta XML file to print differences
options - the option file
Returns:
  • the value 0 if two XML files are equal;
  • the value 1 if two XML files are not equal;
  • the value 2 if the error(s) occur

main

public static void main(java.lang.String[] argv)
A main method of the ExamXML class.

JVM calls this method when the JExamXML application is used as standalone Java application.

Parameters:
argv - the command line arguments

setLogFile

public static void setLogFile(java.lang.String logFileName)
Sets the log file name.

Parameters:
logFileName -