Transform a folder of XML files

If you ever need to bulk transform a directory of xml files, and output each transformed file into a new directory then Saxon has a great command line interface tool that will do just that, in one simple line!

CD C:\Users\caulfiek\Testing java -jar c:\Users\caulfiek\XSLT\saxonHE9-8-0-8j\saxon9he.jar -s:sourceDir\ -xsl:FPML_Masking.xslt -o:targetDir
Here I have  a stylesheet that performs an identity transform on a xml file, but uses xpath to find and mask certain xml node values (like customer name and transaction number).
Download the saxonHE9 cli tool from here:
Create a directory “sourceDir” and “targetDir”
Fill your “sourceDir” with lots of XML files and set up the command as above on your DOS command prompt.


Leave a Reply