diff options
Diffstat (limited to 'test/schematron')
54 files changed, 340 insertions, 0 deletions
diff --git a/test/schematron/zvon1.sct b/test/schematron/zvon1.sct new file mode 100644 index 0000000..36179dd --- /dev/null +++ b/test/schematron/zvon1.sct @@ -0,0 +1,23 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Print both cases"> + <rule context="AAA"> + <assert test="BBB">BBB element is missing.</assert> + <report test="BBB">BBB element is present.</report> + <assert test="@name">AAA misses attribute name.</assert> + <report test="@name">AAA contains attribute name.</report> + </rule> + </pattern> + <pattern name="Print positive result only"> + <rule context="AAA"> + <report test="BBB">BBB element is present.</report> + <report test="@name">AAA contains attribute name.</report> + </rule> + </pattern> + <pattern name="Print negative result only"> + <rule context="AAA"> + <assert test="BBB">BBB element is missing.</assert> + <assert test="@name">AAA misses attribute name.</assert> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon10.sct b/test/schematron/zvon10.sct new file mode 100644 index 0000000..783fac5 --- /dev/null +++ b/test/schematron/zvon10.sct @@ -0,0 +1,15 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Open model"> + <rule context="AAA"> + <assert test="BBB"> BBB element is not present</assert> + <assert test="CCC"> CCC element is not present</assert> + </rule> + </pattern> + <pattern name="Closed model"> + <rule context="AAA"> + <assert test="BBB"> BBB element is not present</assert> + <assert test="CCC"> CCC element is not present</assert> + <assert test="count(BBB|CCC) = count (*)">There is an extra element</assert> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon10_0.xml b/test/schematron/zvon10_0.xml new file mode 100644 index 0000000..d3ac388 --- /dev/null +++ b/test/schematron/zvon10_0.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB/> +</AAA> diff --git a/test/schematron/zvon10_1.xml b/test/schematron/zvon10_1.xml new file mode 100644 index 0000000..ba9bdca --- /dev/null +++ b/test/schematron/zvon10_1.xml @@ -0,0 +1,4 @@ +<AAA> + <BBB/> + <DDD/> +</AAA> diff --git a/test/schematron/zvon11.sct b/test/schematron/zvon11.sct new file mode 100644 index 0000000..79b01fd --- /dev/null +++ b/test/schematron/zvon11.sct @@ -0,0 +1,8 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Attributes present"> + <rule context="BBB"> + <assert test="not(@aaa) or (@aaa and @bbb)">The element must not have an isolated aaa attribute</assert> + <assert test="not(@bbb) or (@aaa and @bbb)">The element must not have an isolated bbb attribute</assert> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon11_0.xml b/test/schematron/zvon11_0.xml new file mode 100644 index 0000000..f065eed --- /dev/null +++ b/test/schematron/zvon11_0.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB aaa="A" bbb="B"/> +</AAA> diff --git a/test/schematron/zvon11_1.xml b/test/schematron/zvon11_1.xml new file mode 100644 index 0000000..c889933 --- /dev/null +++ b/test/schematron/zvon11_1.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB bbb="B"/> +</AAA> diff --git a/test/schematron/zvon11_2.xml b/test/schematron/zvon11_2.xml new file mode 100644 index 0000000..26e1221 --- /dev/null +++ b/test/schematron/zvon11_2.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB aaa="A"/> +</AAA> diff --git a/test/schematron/zvon11_3.xml b/test/schematron/zvon11_3.xml new file mode 100644 index 0000000..d3ac388 --- /dev/null +++ b/test/schematron/zvon11_3.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB/> +</AAA> diff --git a/test/schematron/zvon12.sct b/test/schematron/zvon12.sct new file mode 100644 index 0000000..049b125 --- /dev/null +++ b/test/schematron/zvon12.sct @@ -0,0 +1,8 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Number of characters in an abbreviation"> + <rule context="BBB"> + <report test="string-length(@bbb) < 2">There is not enough letters in the abbreviation</report> + <report test="string-length(@bbb) > 3">There is too much letters in the abbreviation</report> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon12_0.xml b/test/schematron/zvon12_0.xml new file mode 100644 index 0000000..d5f28d5 --- /dev/null +++ b/test/schematron/zvon12_0.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB bbb="C"/> +</AAA> diff --git a/test/schematron/zvon12_1.xml b/test/schematron/zvon12_1.xml new file mode 100644 index 0000000..3507f6b --- /dev/null +++ b/test/schematron/zvon12_1.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB bbb="CZ"/> +</AAA> diff --git a/test/schematron/zvon12_2.xml b/test/schematron/zvon12_2.xml new file mode 100644 index 0000000..e0d81af --- /dev/null +++ b/test/schematron/zvon12_2.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB bbb="CZCZ"/> +</AAA> diff --git a/test/schematron/zvon13.sct b/test/schematron/zvon13.sct new file mode 100644 index 0000000..cd433e0 --- /dev/null +++ b/test/schematron/zvon13.sct @@ -0,0 +1,7 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Sum equals 100%."> + <rule context="Total"> + <assert test="sum(//Percent) = 100">The values do not sum to 100%. </assert> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon13_0.xml b/test/schematron/zvon13_0.xml new file mode 100644 index 0000000..52619c3 --- /dev/null +++ b/test/schematron/zvon13_0.xml @@ -0,0 +1,6 @@ +<Total> + <Percent>20</Percent> + <Percent>30</Percent> + <Percent>10</Percent> + <Percent>50</Percent> +</Total> diff --git a/test/schematron/zvon13_1.xml b/test/schematron/zvon13_1.xml new file mode 100644 index 0000000..8fb7368 --- /dev/null +++ b/test/schematron/zvon13_1.xml @@ -0,0 +1,5 @@ +<Total> + <Percent>20</Percent> + <Percent>10</Percent> + <Percent>50</Percent> +</Total> diff --git a/test/schematron/zvon13_2.xml b/test/schematron/zvon13_2.xml new file mode 100644 index 0000000..af4d76a --- /dev/null +++ b/test/schematron/zvon13_2.xml @@ -0,0 +1,5 @@ +<Total> + <Percent>20</Percent> + <Percent>30</Percent> + <Percent>50</Percent> +</Total> diff --git a/test/schematron/zvon14.sct b/test/schematron/zvon14.sct new file mode 100644 index 0000000..f98b6d8 --- /dev/null +++ b/test/schematron/zvon14.sct @@ -0,0 +1,10 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="a child of selected elements"> + <rule context="CCC"> + <assert test="parent::*[name()='BBB' or name()='DDD']">Element CCC must not be a child of element + <name path="parent::*"/> + </assert> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon14_0.xml b/test/schematron/zvon14_0.xml new file mode 100644 index 0000000..b627043 --- /dev/null +++ b/test/schematron/zvon14_0.xml @@ -0,0 +1,12 @@ +<AAA> + <BBB> + <CCC/> + </BBB> + <CCC/> + <DDD> + <CCC/> + <EEE> + <CCC/> + </EEE> + </DDD> +</AAA> diff --git a/test/schematron/zvon15.sct b/test/schematron/zvon15.sct new file mode 100644 index 0000000..7da5d86 --- /dev/null +++ b/test/schematron/zvon15.sct @@ -0,0 +1,11 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="id is the only permited attribute name"> + <rule context="*"> + <report test="@*[not(name()='id')]">Attribute + <name path="@*[not(name()='id')]"/> is forbidden in element + <name/> + </report> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon15_0.xml b/test/schematron/zvon15_0.xml new file mode 100644 index 0000000..390aedb --- /dev/null +++ b/test/schematron/zvon15_0.xml @@ -0,0 +1,4 @@ +<AAA name="aaa"> +<BBB id="bbb"/> +<CCC color="ccc"/> +</AAA> diff --git a/test/schematron/zvon1_0.xml b/test/schematron/zvon1_0.xml new file mode 100644 index 0000000..d3ac388 --- /dev/null +++ b/test/schematron/zvon1_0.xml @@ -0,0 +1,3 @@ +<AAA> + <BBB/> +</AAA> diff --git a/test/schematron/zvon1_1.xml b/test/schematron/zvon1_1.xml new file mode 100644 index 0000000..861c90a --- /dev/null +++ b/test/schematron/zvon1_1.xml @@ -0,0 +1,3 @@ +<AAA> + <CCC/> +</AAA> diff --git a/test/schematron/zvon2.sct b/test/schematron/zvon2.sct new file mode 100644 index 0000000..56974a0 --- /dev/null +++ b/test/schematron/zvon2.sct @@ -0,0 +1,9 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Character @ forbidden"> + <rule context="*"> + <report test="contains(.,'@')">Text in element + <name/> must not contain character @ + </report> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon2_0.xml b/test/schematron/zvon2_0.xml new file mode 100644 index 0000000..832c507 --- /dev/null +++ b/test/schematron/zvon2_0.xml @@ -0,0 +1,4 @@ +<AAA> + <BBB>bbbb</BBB> + <CCC>cccc</CCC> +</AAA> diff --git a/test/schematron/zvon2_1.xml b/test/schematron/zvon2_1.xml new file mode 100644 index 0000000..6ade195 --- /dev/null +++ b/test/schematron/zvon2_1.xml @@ -0,0 +1,4 @@ +<AAA> + <BBB>bbbb@bbb.com</BBB> + <CCC>ccc@ccc.com</CCC> +</AAA> diff --git a/test/schematron/zvon2_2.xml b/test/schematron/zvon2_2.xml new file mode 100644 index 0000000..812d44a --- /dev/null +++ b/test/schematron/zvon2_2.xml @@ -0,0 +1,5 @@ +<AAA> + <BBB>bbbb</BBB> + <CCC>cccc</CCC> + aaa@aaa.net +</AAA> diff --git a/test/schematron/zvon3.sct b/test/schematron/zvon3.sct new file mode 100644 index 0000000..f75b67b --- /dev/null +++ b/test/schematron/zvon3.sct @@ -0,0 +1,8 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Attribute test"> + <rule context="CCC"> + <assert test="@name">attribute name is not present</assert> + <report test="@name">attribute name is present</report> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon3_0.xml b/test/schematron/zvon3_0.xml new file mode 100644 index 0000000..ec8dc43 --- /dev/null +++ b/test/schematron/zvon3_0.xml @@ -0,0 +1,8 @@ +<AAA> + <BBB> + <CCC/> + <CCC/> + </BBB> + <CCC name="c1"/> + <CCC name="c2"/> +</AAA> diff --git a/test/schematron/zvon4.sct b/test/schematron/zvon4.sct new file mode 100644 index 0000000..0b8a4e1 --- /dev/null +++ b/test/schematron/zvon4.sct @@ -0,0 +1,10 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Root test"> + <rule context="/*"> + <assert test="name()='AAA'">Root element is + <name/>, not AAA + </assert> + <report test="name()='AAA'">Root element is AAA</report> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon4_0.xml b/test/schematron/zvon4_0.xml new file mode 100644 index 0000000..4ba332e --- /dev/null +++ b/test/schematron/zvon4_0.xml @@ -0,0 +1,6 @@ +<AAA> + <BBB> + <CCC/> + <CCC/> + </BBB> +</AAA> diff --git a/test/schematron/zvon4_1.xml b/test/schematron/zvon4_1.xml new file mode 100644 index 0000000..5becbcf --- /dev/null +++ b/test/schematron/zvon4_1.xml @@ -0,0 +1,6 @@ +<XXX> + <BBB> + <CCC/> + <CCC/> + </BBB> +</XXX> diff --git a/test/schematron/zvon5.sct b/test/schematron/zvon5.sct new file mode 100644 index 0000000..36cb8bb --- /dev/null +++ b/test/schematron/zvon5.sct @@ -0,0 +1,12 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Select empty elements CCC"> + <rule context="CCC"> + <assert test="normalize-space(.) and *">Source contains an empty element CCC </assert> + <report test="normalize-space(.) = ''">[1]An element CCC does not contain any text</report> + <assert test="normalize-space(.)">[2]An element CCC does not contain any text</assert> + <report test="not(*)">[1]An element CCC does not contain any child element</report> + <assert test="*">[2]An element CCC does not contain any child element</assert> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon5_0.xml b/test/schematron/zvon5_0.xml new file mode 100644 index 0000000..dc7c36b --- /dev/null +++ b/test/schematron/zvon5_0.xml @@ -0,0 +1,5 @@ +<AAA> + <BBB> + <CCC/> + </BBB> +</AAA> diff --git a/test/schematron/zvon5_1.xml b/test/schematron/zvon5_1.xml new file mode 100644 index 0000000..6915fa6 --- /dev/null +++ b/test/schematron/zvon5_1.xml @@ -0,0 +1,5 @@ +<AAA> + <BBB> + <CCC>I am CCC element</CCC> + </BBB> +</AAA> diff --git a/test/schematron/zvon5_2.xml b/test/schematron/zvon5_2.xml new file mode 100644 index 0000000..2a11400 --- /dev/null +++ b/test/schematron/zvon5_2.xml @@ -0,0 +1,7 @@ +<AAA> + <BBB> + <CCC> + <DDD/> + </CCC> + </BBB> +</AAA> diff --git a/test/schematron/zvon6.sct b/test/schematron/zvon6.sct new file mode 100644 index 0000000..678ae58 --- /dev/null +++ b/test/schematron/zvon6.sct @@ -0,0 +1,8 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Predefined values"> + <rule context="AAA"> + <report test="normalize-space(.) = 'aaa' or normalize-space(.) = 'bbb'">O.K.</report> + <assert test="normalize-space(.) = 'aaa' or normalize-space(.) = 'bbb'">The AAA value is not permitted.</assert> + </rule> + </pattern> +</schema> diff --git a/test/schematron/zvon6_0.xml b/test/schematron/zvon6_0.xml new file mode 100644 index 0000000..a3efb70 --- /dev/null +++ b/test/schematron/zvon6_0.xml @@ -0,0 +1,3 @@ +<AAA> +aaa +</AAA> diff --git a/test/schematron/zvon6_1.xml b/test/schematron/zvon6_1.xml new file mode 100644 index 0000000..7d7daf8 --- /dev/null +++ b/test/schematron/zvon6_1.xml @@ -0,0 +1,3 @@ +<AAA> + bbb +</AAA> diff --git a/test/schematron/zvon6_2.xml b/test/schematron/zvon6_2.xml new file mode 100644 index 0000000..555f24d --- /dev/null +++ b/test/schematron/zvon6_2.xml @@ -0,0 +1,3 @@ +<AAA> + ccc +</AAA> diff --git a/test/schematron/zvon7.sct b/test/schematron/zvon7.sct new file mode 100644 index 0000000..a22a89e --- /dev/null +++ b/test/schematron/zvon7.sct @@ -0,0 +1,9 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Test integer"> + <rule context="AAA"> + <report test="floor(.) = number(.)">O.K.</report> + <assert test="floor(.) = number(.)">The AAA value is not an integer.</assert> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon7_0.xml b/test/schematron/zvon7_0.xml new file mode 100644 index 0000000..a3efb70 --- /dev/null +++ b/test/schematron/zvon7_0.xml @@ -0,0 +1,3 @@ +<AAA> +aaa +</AAA> diff --git a/test/schematron/zvon7_1.xml b/test/schematron/zvon7_1.xml new file mode 100644 index 0000000..8da0ae5 --- /dev/null +++ b/test/schematron/zvon7_1.xml @@ -0,0 +1,3 @@ +<AAA> + 12.234 +</AAA> diff --git a/test/schematron/zvon7_2.xml b/test/schematron/zvon7_2.xml new file mode 100644 index 0000000..e27cfe7 --- /dev/null +++ b/test/schematron/zvon7_2.xml @@ -0,0 +1,3 @@ +<AAA> +45 +</AAA> diff --git a/test/schematron/zvon7_3.xml b/test/schematron/zvon7_3.xml new file mode 100644 index 0000000..c17295a --- /dev/null +++ b/test/schematron/zvon7_3.xml @@ -0,0 +1,3 @@ +<AAA> +0 +</AAA> diff --git a/test/schematron/zvon7_4.xml b/test/schematron/zvon7_4.xml new file mode 100644 index 0000000..4f34fbe --- /dev/null +++ b/test/schematron/zvon7_4.xml @@ -0,0 +1,3 @@ +<AAA> +-45 +</AAA> diff --git a/test/schematron/zvon8.sct b/test/schematron/zvon8.sct new file mode 100644 index 0000000..5641ecd --- /dev/null +++ b/test/schematron/zvon8.sct @@ -0,0 +1,10 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Test count"> + <rule context="/*"> + <report test="count(//BBB) = count(//AAA)">O.K.</report> + <assert test="count(//BBB) <= count(//AAA)">Some AAA are missing</assert> + <report test="count(//BBB) < count(//AAA)">Some BBB are missing</report> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon8_0.xml b/test/schematron/zvon8_0.xml new file mode 100644 index 0000000..b6739bb --- /dev/null +++ b/test/schematron/zvon8_0.xml @@ -0,0 +1,8 @@ +<XXX> + <BBB/> + <BBB/> + <AAA/> + <BBB/> + <AAA/> + <AAA/> +</XXX> diff --git a/test/schematron/zvon8_1.xml b/test/schematron/zvon8_1.xml new file mode 100644 index 0000000..196dbe2 --- /dev/null +++ b/test/schematron/zvon8_1.xml @@ -0,0 +1,7 @@ +<XXX> + <BBB/> + <AAA/> + <BBB/> + <AAA/> + <AAA/> +</XXX> diff --git a/test/schematron/zvon8_2.xml b/test/schematron/zvon8_2.xml new file mode 100644 index 0000000..f85de82 --- /dev/null +++ b/test/schematron/zvon8_2.xml @@ -0,0 +1,7 @@ +<XXX> + <BBB/> + <BBB/> + <AAA/> + <BBB/> + <AAA/> +</XXX> diff --git a/test/schematron/zvon9.sct b/test/schematron/zvon9.sct new file mode 100644 index 0000000..6f67877 --- /dev/null +++ b/test/schematron/zvon9.sct @@ -0,0 +1,9 @@ +<schema xmlns="http://www.ascc.net/xml/schematron" > + <pattern name="Test attribute"> + <rule context="CCC"> + <report test="parent::BBB and not(@id)">Attribute id is missing</report> + <report test="not(parent::BBB) and @id">Attribute id is used in wrong context</report> + </rule> + </pattern> +</schema> + diff --git a/test/schematron/zvon9_0.xml b/test/schematron/zvon9_0.xml new file mode 100644 index 0000000..d871519 --- /dev/null +++ b/test/schematron/zvon9_0.xml @@ -0,0 +1,7 @@ +<AAA> + <CCC/> + <CCC/> + <BBB> + <CCC id="Q1"/> + </BBB> +</AAA> diff --git a/test/schematron/zvon9_1.xml b/test/schematron/zvon9_1.xml new file mode 100644 index 0000000..5c1c1bf --- /dev/null +++ b/test/schematron/zvon9_1.xml @@ -0,0 +1,7 @@ +<AAA> + <CCC id="Q2"/> + <CCC/> + <BBB> + <CCC id="Q1"/> + </BBB> +</AAA> diff --git a/test/schematron/zvon9_2.xml b/test/schematron/zvon9_2.xml new file mode 100644 index 0000000..7e09fab --- /dev/null +++ b/test/schematron/zvon9_2.xml @@ -0,0 +1,7 @@ +<AAA> + <CCC/> + <CCC/> + <BBB> + <CCC/> + </BBB> +</AAA> |