Last active
March 22, 2018 13:39
-
-
Save jdvivar/4854e44cc2ddca52266e3ca2ea699bc9 to your computer and use it in GitHub Desktop.
Excerpt of a script to compile Sagepay XML/XSLT2 into HTML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This file is a excerpt of a bigger script | |
# Files lists, they should be matching | |
xml_list=( | |
'authorisation' | |
'card_authentication' | |
'card_details' | |
'error' | |
) | |
xslt_list=( | |
'authorisation_low' | |
'card_authentication_low' | |
'card_details_low' | |
'error' | |
) | |
# Compile files into html | |
compile() | |
{ | |
n=0 | |
while [ "${xslt_list[n]}" != "" ] | |
do | |
echo "Compiling ${xml_list[n]} ..." | |
saxon -s:XML/${xml_list[n]}.xml -xsl:XSLT/${xslt_list[n]}.xslt -o:HTML/${xml_list[n]}.html | |
n=$[n + 1] | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment