Ready to Learn?Ex Libris products all provide open APIs

Tech Blog

 

convert Alma invoices from XML to CSV

Tamar Fuches on December 30th, 2014

The content of this article was contributed by Catherine Wilbur from the University of Windsor <cwilbur@UWINDSOR.CA>
 
In the University of Windsor We use ERP Enterprise One version 8.0 as our Finance system.
This system expects invoices in CSV format. We use XSLT in order to convert the Alma exported invoices from XML format to the CSV format.
For more information regarding the Alma export invoices format, see Invoice Export.

Following is detailed description of the converter that we use:
  1. We wrote our Stylesheet in Windows 7 using editx-xmleditor freeware, and moved it afterwards to Unix.
  2. We use Saxon-HE XML processor in order to convert the Alma output xml file to comma separated format as specified in the rules of the stylesheet.
  3. Current Saxon java version installed is SaxonHE9-6-0-2J.Newer releases of Saxon-He can be found in Saxon-HE/
  4. Our XSLT code
  5. The call to Saxon from Unix script command line:
java -cp -jar:/classpath/saxon9he.jar net.sf.saxon.Transform -s:/classpath/InputFile.xml -xsl:/classpath/stylesheet.xsl -o:/classpath/OutputFile.csv

Explanation :
Java will run net.sf.saxon.Transform program, which is the entry point of the Saxon XSLT processor.
The options to the left of net.sf.saxon.Transform are options for Java, those to the right are options for Saxon.
-cp indicates that you are to use the classpath defined to find Java and Saxon directories. You must make sure your Classpath is defined correctly to include Java and Saxon jar file(s)

Saxon 6 version parameters uses space.
Saxon 9 version parameters uses colon.