xsl-list
[Top] [All Lists]

Re: [xsl] How do I set up my Saxon call to update/pass back a log file

2015-03-14 04:44:32
Can you define "does not work properly"? Is it synonymous with "fails with a 
dynamic error?

Saxon does pass a simple return code back to the shell when a static or dynamic 
error occurs, and of course it does allow you to redirect standard error output 
to a file.

But I'm afraid if I were attempting something like this, I wouldn't put the 
logic in a shell script, I would put it in a Java application. Your mileage may 
vary.

Michael Kay
Saxonica
mike(_at_)saxonica(_dot_)com
+44 (0) 118 946 5893




On 13 Mar 2015, at 20:13, Catherine Wilbur cwilbur(_at_)uwindsor(_dot_)ca 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

If this Saxon call does not work properly I want to send emails to certain 
individuals plus to the production mailbox.  How do I put a log file in this 
Saxon call so I trap what happened in the call and pass the log file in the 
msg body when I email the log in the commented code just below? 

    /usr/java5/bin/java -cp $SAXON_JAR net.sf.saxon.Transform 
-s:$FinesrvDataDir/Library_Invoice_Interface.xml 
-xsl:$FinesrvCronDir/LibrXML2CSV_stylesheet.xsl 
-o:$FinesrvDataDir/Library_Invoice_Interface.csv 


Currently I have this unix code commented out. 

   # XML file did not convert properly into CSV file 
   # ================================================================== 
#  if [! -s $FinesrvDataDir/Library_Invoice_Interface.csv ] 
#  then 
#      cp $FinesrvDataDir/Library_Invoice_Interface.log 
$FinesrvDataDir/Library_Invoice_Interface.tmp 
#      MessageFile=$FinesrvDataDir/Library_Invoice_Interface.tmp 
#      msg="FAILED - Library Invoice data did not convert properly from XML 
to CSV in the stylesheet" 
#      mail -s "$msg" cwp?????@uwindsor.ca < $MessageFile 
#      mail -s "$msg" mkp????@uwindsor.ca < $MessageFile 
#      mail -s "$msg" mka????@uwindsor.ca < $MessageFile 
#      mail -s "$msg" prodmailbox(_at_)uwindsor(_dot_)ca < $MessageFile 
#      rm ${MessageFile} 
# 
#      echo '---------------------------------------------------' 
#      echo 'PROBLEM with Input data.' 
#      echo 'Library A/P Interface COULD NOT BE converted from XML to CSV.' 
#      echo '---------------------------------------------------' 
#  fi 
fi 

_____________________________________________________________________
Catherine Wilbur  |  Senior Application Programmer  |  IT Services 
401 Sunset Avenue, Windsor ON Canada  N9B 3P4 
(T) 519.253.3000 Ext. 2745  |  (F) 519.973.7083  |  (E) 
cwilbur(_at_)uwindsor(_dot_)ca 
www.uwindsor.ca/its
XSL-List info and archive
EasyUnsubscribe (by email)
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>