summaryrefslogtreecommitdiff
path: root/oracle-conversion/fixml.sh
diff options
context:
space:
mode:
Diffstat (limited to 'oracle-conversion/fixml.sh')
-rwxr-xr-xoracle-conversion/fixml.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/oracle-conversion/fixml.sh b/oracle-conversion/fixml.sh
new file mode 100755
index 0000000..75bbcf8
--- /dev/null
+++ b/oracle-conversion/fixml.sh
@@ -0,0 +1,7 @@
+sed -e "s/ *$//" -e "s/^ *//" -e "/^$/d" $1 | \
+ sed 's/^SQL.*from \([^ ]*\)'"'"'.*/<ROWSET NAME="\1">/' | \
+ sed -e "/<ROWSET>/d" -e "/^SQL/d" -e '/^<?xml/d' | \
+ sed -e '1i <DATABASE>' -e '$a </DATABASE>' | \
+ sed -e :a -e 'N;s/\n//g' -e ba | \
+ sed 's: *</:</:g' | \
+ xmllint --format -