#! /bin/bash
cyflexlogevent -t generic -m 1 -m "script" -m "$0" 

#
# Script name: xml_xsl_transform <XML_FILE> <XSLT_FILE>
#
# Purpose: Transform an XML file using an XSLT transform file.
#
# Invoking arguments:
#    1 - xml file to be transformed by the xslt file.
#    2 - xslt file to transform the xml file.
#    3 - transformed output file (optional)
#
# Output:
#    The transformed information is written to standard output.
#    Any errors are written to standard error.
#    Return code 1 is returned if there are any errors, 0 if the
#       transform was successful.
#
# History:
#    11/10/10 - Rob Janes - Initial release
#    08/04/11 - Rob Janes - Allow optional 3rd argument
#

# Argument check and usage information.
if (( $# < 2 )); then
   echo Usage: xml_xsl_transform XML_FILE  XSLT_FILE OUTPUT_FILE
   exit 1
fi

. configure_java

export CLASSPATH=$GUI/applications.jar\
:$GUI/specfilegui.jar\
:$D3/jcmdline.jar\
:$D3/protobuf.jar
PROPS=-DPropertiesFile=$CELL/cui_properties.txt
java $PROPS com.cybermetrix.cyflex.applications.xml_xsl_transform $*
