1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-28 07:21:26 +03:00

added a bunch of tests from Kasimier Buchcik posted on May 11 Daniel

* test/schemas/* result/schemas/*: added a bunch of tests from
  Kasimier Buchcik posted on May 11
Daniel
This commit is contained in:
Daniel Veillard 2004-06-04 09:29:37 +00:00
parent 8acdfbf53c
commit 8839938822
61 changed files with 362 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Fri Jun 4 11:27:37 CEST 2004 Daniel Veillard <daniel@veillard.com>
* test/schemas/* result/schemas/*: added a bunch of tests from
Kasimier Buchcik posted on May 11
Thu Jun 3 17:58:25 CEST 2004 Daniel Veillard <daniel@veillard.com>
* xmlschemas.c: new patch from Kasimier Buchcik for processContents

View File

@ -0,0 +1 @@
./test/schemas/bug141312_0.xml validates

View File

View File

View File

@ -0,0 +1 @@
./test/schemas/scc-no-xmlns_0.xsd:7: element attribute: Schemas parser error : The name of an attribute declaration must not match "xmlns".

View File

View File

@ -0,0 +1 @@
./test/schemas/scc-no-xsi_0.xsd:7: element attribute: Schemas parser error : The target namespace of an attribute declaration, must not match "http://www.w3.org/2001/XMLSchema-instance"

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute1_0.xsd:9: element attribute: Schemas parser error : Attribute declaration has both, "default" and "fixed"

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute2_0.xsd:9: element attribute: Schemas parser error : Attribute declaration has "default" but "use" is not "optional"

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute3-1_0.xsd:9: element attribute: Schemas parser error : Attribute declaration "bar" has both, "name" and "ref"

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute3-2-form_0.xsd:10: element attribute: Schemas parser error : Attribute declaration anonattr 2 has "ref", thus "form" must be absent

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute3-2-st_0.xsd:11: element simpleType: Schemas parser error : Attribute declaration anonattr 2 has both ("ref" or "type") and <simpleType>

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute3-2-type_0.xsd:10: element attribute: Schemas parser error : Attribute declaration anonattr 2 has "ref", thus "type" must be absent

View File

View File

@ -0,0 +1 @@
./test/schemas/src-attribute4_0.xsd:8: element simpleType: Schemas parser error : Attribute declaration bar has both ("ref" or "type") and <simpleType>

View File

View File

@ -0,0 +1 @@
./test/schemas/src-element1_0.xsd:7: element element: Schemas parser error : Element foo has both default and fixed

View File

View File

@ -0,0 +1 @@
./test/schemas/src-element2-1_0.xsd:12: element element: Schemas parser error : Element declaration has both, "name" and "ref"

View File

View File

@ -0,0 +1,8 @@
./test/schemas/src-element2-2_0.xsd:23: element complexType: Schemas parser error : Element declaration anonelem 6: only annotation is allowed as content in addition to ref
./test/schemas/src-element2-2_0.xsd:29: element simpleType: Schemas parser error : Element declaration anonelem 7: only annotation is allowed as content in addition to ref
./test/schemas/src-element2-2_0.xsd:36: element element: Schemas parser error : Element declaration anonelem 8: only minOccurs, maxOccurs and id are allowed in addition to ref
./test/schemas/src-element2-2_0.xsd:37: element element: Schemas parser error : Element declaration anonelem 9: only minOccurs, maxOccurs and id are allowed in addition to ref
./test/schemas/src-element2-2_0.xsd:38: element element: Schemas parser error : Element declaration anonelem 10: only minOccurs, maxOccurs and id are allowed in addition to ref
./test/schemas/src-element2-2_0.xsd:39: element element: Schemas parser error : Element declaration anonelem 11: only minOccurs, maxOccurs and id are allowed in addition to ref
./test/schemas/src-element2-2_0.xsd:40: element element: Schemas parser error : Element declaration anonelem 12: only minOccurs, maxOccurs and id are allowed in addition to ref
./test/schemas/src-element2-2_0.xsd:41: element element: Schemas parser error : Element declaration anonelem 13: only minOccurs, maxOccurs and id are allowed in addition to ref

View File

View File

@ -0,0 +1,2 @@
./test/schemas/src-element3_0.xsd:8: element complexType: Schemas parser error : Element declaration foo has both "type" and a local complex type
./test/schemas/src-element3_0.xsd:16: element simpleType: Schemas parser error : Element declaration bar has both "type" and a local simple type

View File

@ -0,0 +1 @@
./test/schemas/xsd-simpleType-varieties_0.xml validates

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<foo xmlns="http://FOO">lalala</foo>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://FOO"
xmlns:foo="http://FOO">
<element name="foo" type="foo:fooType" nillable="false" />
<complexType name="fooType" mixed="true">
<simpleContent>
<extension base="string" />
</simpleContent>
</complexType>
</schema>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://foo"/>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- C.4 Schema Component Constraints: no-xmlns -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute name="xmlns" type="string" />
</complexType>
</element>
</schema>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://foo"/>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.6 Schema Component Constraint: xsi: Not Allowed -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema-instance">
<element name="foo">
<complexType>
<attribute name="bar" form="qualified" type="string"/>
</complexType>
</element>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 1
default and fixed must not both be present
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute name="bar" type="string" default="moo" fixed="true"/>
</complexType>
</element>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 2
If default and use are both present, use must have the ·actual value· optional
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute name="bar" type="string" use="required" default="moo" />
</complexType>
</element>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3.1
One of ref or name must be present, but not both
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute name="bar" ref="foo:bar" />
</complexType>
</element>
<attribute name="bar" type="string" />
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3.2
If ref is present, then all of <simpleType>, form and type must be absent
This one tests "form"
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute ref="foo:bar" form="qualified"/>
</complexType>
</element>
<attribute name="bar" type="string"/>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3.2
If ref is present, then all of <simpleType>, form and type must be absent
This one tests <simpleType>
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute ref="foo:bar">
<simpleType>
<restriction base="string">
<maxLength value="20"/>
</restriction>
</simpleType>
</attribute>
</complexType>
</element>
<attribute name="bar" type="string" />
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3.2
If ref is present, then all of <simpleType>, form and type must be absent
This one tests "type"
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo">
<complexType>
<attribute ref="foo:bar" type="string"/>
</complexType>
</element>
<attribute name="bar" type="string"/>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3.2
type and <simpleType> must not both be present
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<attribute name="bar" type="string">
<simpleType>
<restriction base="string">
<maxLength value="20"/>
</restriction>
</simpleType>
</attribute>
<element name="foo"/>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 1
default and fixed must not both be present
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo" type="string" default="Joni" fixed="Mitchel"/>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 2.1
One of ref or name must be present, but not both.
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="bar" type="string"/>
<element name="foo">
<complexType>
<sequence>
<element name="bar" ref="foo:bar"/>
</sequence>
</complexType>
</element>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 2.2
If ref is present, then all of <complexType>, <simpleType>, <key>, <keyref>, <unique>,
nillable, default, fixed, form, block and type must be absent, i.e. only minOccurs, maxOccurs,
id are allowed in addition to ref, along with <annotation>.
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="bar" type="string"/>
<element name="foo">
<complexType>
<choice>
<!-- The good ones. -->
<element ref="foo:bar" minOccurs="0"/>
<element ref="foo:bar" maxOccurs="0"/>
<element ref="foo:bar" id="myomy"/>
<!-- The bad ones. -->
<element ref="foo:bar">
<complexType>
<attribute name="bar" type="string"/>
</complexType>
</element>
<element ref="foo:bar">
<simpleType>
<restriction base="string">
<maxLength value="20"/>
</restriction>
</simpleType>
</element>
<element ref="foo:bar" type="string"/>
<element ref="foo:bar" nillable="true"/>
<element ref="foo:bar" default="Joni"/>
<element ref="foo:bar" fixed="Mitchel"/>
<element ref="foo:bar" form="unqualified"/>
<element ref="foo:bar" block="restriction"/>
</choice>
</complexType>
</element>
</schema>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo xmlns="http://FOO"/>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- 3.2.3 : 3
type and either <simpleType> or <complexType> are mutually exclusive
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://foo" xmlns:foo="http://foo">
<element name="foo" type="foo:someType">
<complexType>
<sequence>
<element name="bar" type="string"/>
</sequence>
</complexType>
</element>
<element name="bar" type="foo:someType">
<simpleType>
<restriction base="string">
<maxLength value="20"/>
</restriction>
</simpleType>
</element>
<complexType name="someType">
<sequence>
<element name="bar" type="string"/>
</sequence>
</complexType>
</schema>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- This is the test data for the check of the implementation of varieties of xsd:simpleType element. -->
<foo xmlns="http://FOO">
<barA>fajita</barA>
<barB>pub pub</barB>
<barC><![CDATA[tequilla]]></barC>
</foo>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- This test checks the implementation of the varieties of the xsd:simpleType element. -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://FOO" xmlns:foo="http://FOO">
<element name="foo">
<complexType>
<sequence maxOccurs="unbounded">
<element name="barA">
<simpleType>
<union memberTypes="foo:typeA foo:typeB"/>
</simpleType>
</element>
<element name="barB">
<simpleType>
<list itemType="foo:typeA"/>
</simpleType>
</element>
<element name="barC">
<simpleType>
<restriction base="string">
<enumeration value="tequilla"/>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
</element>
<simpleType name="typeA">
<restriction base="string">
<enumeration value="pub"/>
</restriction>
</simpleType>
<simpleType name="typeB">
<restriction base="string">
<enumeration value="fajita"/>
</restriction>
</simpleType>
</schema>