diff options
Diffstat (limited to 'xsd-tests/schema/list')
-rw-r--r-- | xsd-tests/schema/list/anonymous/test.xsd | 16 | ||||
-rw-r--r-- | xsd-tests/schema/list/any-simple-type/test.xsd | 12 | ||||
-rw-r--r-- | xsd-tests/schema/list/buildfile | 31 | ||||
-rw-r--r-- | xsd-tests/schema/list/test.xsd | 72 | ||||
-rw-r--r-- | xsd-tests/schema/list/testscript | 8 |
5 files changed, 139 insertions, 0 deletions
diff --git a/xsd-tests/schema/list/anonymous/test.xsd b/xsd-tests/schema/list/anonymous/test.xsd new file mode 100644 index 0000000..7db39ba --- /dev/null +++ b/xsd-tests/schema/list/anonymous/test.xsd @@ -0,0 +1,16 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <xsd:simpleType name="IntList"> + <xsd:list> + <xsd:simpleType> + <xsd:restriction base="xsd:int"/> + </xsd:simpleType> + </xsd:list> + </xsd:simpleType> + +</xsd:schema> diff --git a/xsd-tests/schema/list/any-simple-type/test.xsd b/xsd-tests/schema/list/any-simple-type/test.xsd new file mode 100644 index 0000000..29fe95c --- /dev/null +++ b/xsd-tests/schema/list/any-simple-type/test.xsd @@ -0,0 +1,12 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <xsd:simpleType name="any"> + <xsd:list itemType="xsd:anySimpleType"/> + </xsd:simpleType> + +</xsd:schema> diff --git a/xsd-tests/schema/list/buildfile b/xsd-tests/schema/list/buildfile new file mode 100644 index 0000000..5d8f7fc --- /dev/null +++ b/xsd-tests/schema/list/buildfile @@ -0,0 +1,31 @@ +# file : schema/list/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +fs = test anonymous/test + +./: {hxx cxx}{$fs} + +# Make sure that the schema files are compilable. +# +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +# Test that the invalid schema files compilation expectedly fails. +# +./: testscript xsd{** -{$fs}} $xsd + +testscript{*}: +{ + test = $xsd + test.arguments = cxx-tree --std c++11 +} diff --git a/xsd-tests/schema/list/test.xsd b/xsd-tests/schema/list/test.xsd new file mode 100644 index 0000000..e16a58d --- /dev/null +++ b/xsd-tests/schema/list/test.xsd @@ -0,0 +1,72 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <xsd:simpleType name="IntList"> + <xsd:list itemType="xsd:int"/> + </xsd:simpleType> + + <!-- local element with anonymous list inside. --> + + <xsd:complexType name="Foo"> + <xsd:sequence> + <xsd:element name="string-list"> + <xsd:simpleType> + <xsd:list itemType="xsd:string"/> + </xsd:simpleType> + </xsd:element> + </xsd:sequence> + </xsd:complexType> + + + <!-- global element with anonymous list inside. --> + + <xsd:element name="string-list"> + <xsd:simpleType> + <xsd:list itemType="xsd:string"/> + </xsd:simpleType> + </xsd:element> + + + + <!-- global element and global list with conflicting names --> + + <xsd:simpleType name="long-list"> + <xsd:list itemType="xsd:long"/> + </xsd:simpleType> + + <xsd:element name="long-list" type="test:long-list"/> + + + <!-- forward reference --> + + <xsd:simpleType name="int-list"> + <xsd:list itemType="test:int"/> + </xsd:simpleType> + + <xsd:simpleType name="int"> + <xsd:restriction base="xsd:int"/> + </xsd:simpleType> + + + <!-- inheritance from list --> + + <xsd:complexType name="IntComplex"> + <xsd:simpleContent> + <xsd:extension base="test:IntList"> + <xsd:attribute name="foo" type="xsd:string"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + <xsd:complexType name="IntComplexEmpty"> + <xsd:simpleContent> + <xsd:extension base="test:IntList"> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + +</xsd:schema> diff --git a/xsd-tests/schema/list/testscript b/xsd-tests/schema/list/testscript new file mode 100644 index 0000000..0916be0 --- /dev/null +++ b/xsd-tests/schema/list/testscript @@ -0,0 +1,8 @@ +# file : schema/list/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: invalid-definition +: +$* --output-dir $~ $src_base/any-simple-type/test.xsd 2>>/"EOE" != 0 + $src_base/any-simple-type/test.xsd:9:45: error: item type definition must have variety of atomic or union where all member types must be atomic + EOE |