From 1aad5017ed99b523dc74912d948a5658dbaaf6ba Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Thu, 27 Feb 2020 11:10:09 +0100 Subject: [PATCH] IssueID #1134: added basic top-down schema for dictionary datasets --- resources/schema/top_dictionaries.xsd | 24 ++++++++++++++++++++++++ scripts/validate_examples | 11 +++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 resources/schema/top_dictionaries.xsd diff --git a/resources/schema/top_dictionaries.xsd b/resources/schema/top_dictionaries.xsd new file mode 100644 index 0000000..9ea7428 --- /dev/null +++ b/resources/schema/top_dictionaries.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/validate_examples b/scripts/validate_examples index d3870b3..4f7b71c 100755 --- a/scripts/validate_examples +++ b/scripts/validate_examples @@ -4,14 +4,21 @@ script_dir="$(dirname "$(readlink -f "$0")")" cd $script_dir schema_dir=../resources/schema +top_schema=$schema_dir/top_dictionaries.xsd # for now we only have dictionaries + example_dir=../examples for example_subdir in $example_dir/* do base=${example_subdir##*/} - schema=$schema_dir/$base.xsd + bottom_schema=$schema_dir/$base.xsd for example_file in $example_subdir/*.xml do - command="xmllint -schema $schema $example_file --noout" + command="xmllint -schema $top_schema $example_file --noout" + echo $command + if ! $command; then + exit 1 + fi + command="xmllint -schema $bottom_schema $example_file --noout" echo $command if ! $command; then exit 1