summaryrefslogtreecommitdiff
path: root/tests/schema/list
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-17 07:15:29 +0200
commitf0510d2f90467de8e8f260b47d79a9baaf9bef17 (patch)
tree0b9929946f06a9cbe9b9e8f2a7600dae4e048f79 /tests/schema/list
Start tracking XSD with git
Diffstat (limited to 'tests/schema/list')
-rw-r--r--tests/schema/list/anonymous/test.xsd16
-rw-r--r--tests/schema/list/any-simple-type/test.xsd12
-rw-r--r--tests/schema/list/driver.cxx13
-rw-r--r--tests/schema/list/test.xsd72
4 files changed, 113 insertions, 0 deletions
diff --git a/tests/schema/list/anonymous/test.xsd b/tests/schema/list/anonymous/test.xsd
new file mode 100644
index 0000000..7db39ba
--- /dev/null
+++ b/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/tests/schema/list/any-simple-type/test.xsd b/tests/schema/list/any-simple-type/test.xsd
new file mode 100644
index 0000000..29fe95c
--- /dev/null
+++ b/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/tests/schema/list/driver.cxx b/tests/schema/list/driver.cxx
new file mode 100644
index 0000000..7bd46e9
--- /dev/null
+++ b/tests/schema/list/driver.cxx
@@ -0,0 +1,13 @@
+#include "test.hxx"
+
+typedef xmlns::test::IntList<void, int> IntListImpl;
+typedef xmlns::test::IntList<void, void> IntListVoidImpl;
+typedef xmlns::test::IntComplex<void, int, char*> IntComplexImpl;
+
+int
+main ()
+{
+ IntListImpl int_list_impl;
+ IntListVoidImpl int_list_void_impl;
+ IntComplexImpl int_complex_impl;
+}
diff --git a/tests/schema/list/test.xsd b/tests/schema/list/test.xsd
new file mode 100644
index 0000000..e16a58d
--- /dev/null
+++ b/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>