summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2012-06-04 21:08:22 +0200
committerJessica Tölke <jtoelke@mail.upb.de>2012-06-11 20:42:33 +0200
commit93b68068f1c940d9437b1849047349b1a8a1e91e (patch)
tree1b248275590c1aa4bb9230b6e73a36dc8216f654 /tools
parentc1acb0b2a575dcf2e04188adc3f8834ce2135b7d (diff)
downloadclientdata-93b68068f1c940d9437b1849047349b1a8a1e91e.tar.gz
clientdata-93b68068f1c940d9437b1849047349b1a8a1e91e.tar.bz2
clientdata-93b68068f1c940d9437b1849047349b1a8a1e91e.tar.xz
clientdata-93b68068f1c940d9437b1849047349b1a8a1e91e.zip
Add a script to automatically format xml files.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/formatXML.sh13
-rw-r--r--tools/indent.xsl7
2 files changed, 20 insertions, 0 deletions
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 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:template match="/">
+ <xsl:copy-of select="."/>
+ </xsl:template>
+</xsl:stylesheet>