IssueID #1134: added basic top-down schema for dictionary datasets
This commit is contained in:
parent
5a1b6e20bf
commit
1aad5017ed
24
resources/schema/top_dictionaries.xsd
Normal file
24
resources/schema/top_dictionaries.xsd
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
|
||||
schemaLocation="http://www.w3.org/2001/xml.xsd" />
|
||||
|
||||
<!-- top-level element is a dictionary -->
|
||||
<xsd:element name="dictionary" type="dictionaryType"/>
|
||||
|
||||
<!-- top-level type consists of sequence of entries -->
|
||||
<xsd:complexType name="dictionaryType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="entry" type="entryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<!-- entry consists of head and body -->
|
||||
<xsd:complexType name="entryType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="head" type="xsd:anyType"/>
|
||||
<xsd:element name="body" type="xsd:anyType"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
</xsd:schema>
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user