From 93b68068f1c940d9437b1849047349b1a8a1e91e Mon Sep 17 00:00:00 2001 From: Jessica Tölke Date: Mon, 4 Jun 2012 21:08:22 +0200 Subject: Add a script to automatically format xml files. --- tools/formatXML.sh | 13 +++++++++++++ tools/indent.xsl | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100755 tools/formatXML.sh create mode 100644 tools/indent.xsl (limited to 'tools') diff --git a/tools/formatXML.sh b/tools/formatXML.sh new file mode 100755 index 00000000..c830f306 --- /dev/null +++ b/tools/formatXML.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cd .. + +for f in $(find -name "*.xml") +do + if [ ${f} != "./items.xml" ]; then + xsltproc tools/indent.xsl ${f} > ${f}__ + mv ${f}__ ${f} + fi +done +xmlindent items.xml > items.xml_ +sed 's/[[:space:]]*$//' items.xml_ > items.xml diff --git a/tools/indent.xsl b/tools/indent.xsl new file mode 100644 index 00000000..7d747abd --- /dev/null +++ b/tools/indent.xsl @@ -0,0 +1,7 @@ + + + + + + + -- cgit v1.2.3-60-g2f50