Skip to content

Instantly share code, notes, and snippets.

@jdvivar
Last active March 22, 2018 13:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jdvivar/4854e44cc2ddca52266e3ca2ea699bc9 to your computer and use it in GitHub Desktop.
Excerpt of a script to compile Sagepay XML/XSLT2 into HTML
#!/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