Package org.xtce.toolkit.examples
Class ConvertDatabaseSchemaVersion
- java.lang.Object
-
- org.xtce.toolkit.examples.ConvertDatabaseSchemaVersion
-
public class ConvertDatabaseSchemaVersion extends Object
This application emits a new XTCE 1.2 compliant XML document from an existing XTCE 1.1 compliant XML document.This demo application can be used directly or extended when other options and/or features are desired.
public static void main( String[] args ) { // be sure the user has provided an XTCE database XML document if ( args.length < 1 ) { System.err.println( "Usage: convertxtcedatabase XTCEFILE" ); // NOI18N System.exit( -1 ); } // convert the provided XTCE XML document from 1.1 schema compliance // to 1.2 schema compliance and if successful, save the file with a // new name using "-1.2.xml" at the end (default new name on save). // alternate names can be provided with the save( File ) method. try { // initialize the converter using XInclude = false XTCEDatabaseConverter converter = new XTCEDatabaseConverter( new File( args[0] ), false ); // perform the modifications to the document structure converter.upgrade(); // normalize the spacing for output on save converter.normalizeDocument(); // save the new file with the default output filename boolean success = converter.save(); // print any messages emitted from the operation for ( String message : converter.getMessages() ) { System.out.println( message ); } if ( success == false ) { System.err.println( "Output file not emitted" ); System.exit( -2 ); } } catch ( Exception ex ) { System.err.println( "Unexpected exception: " + ex.getLocalizedMessage() ); System.exit( -3 ); } }- Author:
- David Overeem
-
-
Constructor Summary
Constructors Constructor Description ConvertDatabaseSchemaVersion()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)This application emits a new XTCE 1.2 compliant XML document from an existing XTCE 1.1 compliant XML document.
-
-
-
Method Detail
-
main
public static void main(String[] args)
This application emits a new XTCE 1.2 compliant XML document from an existing XTCE 1.1 compliant XML document.- Parameters:
args- String array of the command line arguments passed by the Java VM. One argument is needed and that is the XML document file.This tool will return a negative exit code value back to the calling process when it is not successful. When successful, the normal return value from the JVM occurs, which should be 0 on most platforms. Errors will also print a string to the STDERR stream.
-
-