From 1a0dc1b126ca40195ebb548df9e230e35f7eaec9 Mon Sep 17 00:00:00 2001 From: Michal Podhradsky Date: Tue, 24 Oct 2023 10:28:01 -0700 Subject: [PATCH] Added XSD and a validation script Signed-off-by: Michal Podhradsky --- system.xsd | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++ validate.sh | 15 +++++++++ 2 files changed, 108 insertions(+) create mode 100644 system.xsd create mode 100755 validate.sh diff --git a/system.xsd b/system.xsd new file mode 100644 index 00000000..d7bb2c7e --- /dev/null +++ b/system.xsd @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/validate.sh b/validate.sh new file mode 100755 index 00000000..aa804424 --- /dev/null +++ b/validate.sh @@ -0,0 +1,15 @@ +#! /usr/bin/env bash +err=0 + +for f in `find . -wholename "./example/*.system"` +do + xmllint --noout --schema system.xsd $f + if (($? != 0)); then + err=$((err + 1)) + fi +done + +if ((${err} > 0)); then + echo "There were errors while parsing" + exit 1 +fi