summaryrefslogtreecommitdiff
path: root/xsd-tests/schema/ref-type
diff options
context:
space:
mode:
Diffstat (limited to 'xsd-tests/schema/ref-type')
-rw-r--r--xsd-tests/schema/ref-type/.gitignore2
-rw-r--r--xsd-tests/schema/ref-type/buildfile24
-rw-r--r--xsd-tests/schema/ref-type/driver.cxx12
-rw-r--r--xsd-tests/schema/ref-type/idref.xsd42
-rw-r--r--xsd-tests/schema/ref-type/idrefs.xsd43
-rw-r--r--xsd-tests/schema/ref-type/invalid-0.xsd17
-rw-r--r--xsd-tests/schema/ref-type/invalid-1.xsd11
7 files changed, 151 insertions, 0 deletions
diff --git a/xsd-tests/schema/ref-type/.gitignore b/xsd-tests/schema/ref-type/.gitignore
new file mode 100644
index 0000000..40af9e9
--- /dev/null
+++ b/xsd-tests/schema/ref-type/.gitignore
@@ -0,0 +1,2 @@
+idref.?xx
+idrefs.?xx
diff --git a/xsd-tests/schema/ref-type/buildfile b/xsd-tests/schema/ref-type/buildfile
new file mode 100644
index 0000000..545d483
--- /dev/null
+++ b/xsd-tests/schema/ref-type/buildfile
@@ -0,0 +1,24 @@
+# file : schema/ref-type/buildfile
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+import libs = libxsd%lib{xsd}
+import libs += libxerces-c%lib{xerces-c}
+
+fs = idref idrefs invalid-0 invalid-1
+
+exe{driver}: {hxx cxx}{* -{$fs}} {hxx cxx}{$fs} $libs
+
+cxx.poptions =+ "-I$out_base"
+
+for f: $fs
+{
+ <{hxx cxx}{$f}>: xsd{$f} $xsd
+ {{
+ diag xsd ($<[0]) # @@ TMP
+
+ $xsd cxx-tree $xsd_cxx_std \
+ --root-element-all \
+ --output-dir $out_base \
+ $path($<[0])
+ }}
+}
diff --git a/xsd-tests/schema/ref-type/driver.cxx b/xsd-tests/schema/ref-type/driver.cxx
new file mode 100644
index 0000000..536ccb2
--- /dev/null
+++ b/xsd-tests/schema/ref-type/driver.cxx
@@ -0,0 +1,12 @@
+// file : schema/ref-type/driver.cxx
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#include "idref.hxx"
+#include "idrefs.hxx"
+#include "invalid-0.hxx"
+#include "invalid-1.hxx"
+
+int
+main (int, char*[])
+{
+}
diff --git a/xsd-tests/schema/ref-type/idref.xsd b/xsd-tests/schema/ref-type/idref.xsd
new file mode 100644
index 0000000..49ebe40
--- /dev/null
+++ b/xsd-tests/schema/ref-type/idref.xsd
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
+ xmlns:test="http://www.codesynthesis.com/xmlns/test"
+ targetNamespace="http://www.codesynthesis.com/xmlns/test">
+
+ <!-- attribute -->
+
+ <xsd:attribute name="attribute" type="xsd:IDREF" xse:refType="test:a-author"/>
+
+ <xsd:complexType name="a-author">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:attribute name="recommends" type="xsd:IDREF" xse:refType="test:a-author"/>
+ </xsd:complexType>
+
+
+ <!-- element -->
+
+ <xsd:element name="element" type="xsd:IDREF" xse:refType="test:e-author"/>
+
+ <xsd:complexType name="e-author">
+ <xsd:sequence>
+ <xsd:element name="recommends" type="xsd:IDREF" xse:refType="test:e-author"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- base -->
+
+ <xsd:simpleType name="author-ref">
+ <xsd:restriction base="xsd:IDREF" xse:refType="test:e-author"/>
+ </xsd:simpleType>
+
+
+ <!-- itemType -->
+
+ <xsd:simpleType name="author-refs">
+ <xsd:list itemType="xsd:IDREF" xse:refType="test:e-author"/>
+ </xsd:simpleType>
+
+</xsd:schema>
diff --git a/xsd-tests/schema/ref-type/idrefs.xsd b/xsd-tests/schema/ref-type/idrefs.xsd
new file mode 100644
index 0000000..b68ed03
--- /dev/null
+++ b/xsd-tests/schema/ref-type/idrefs.xsd
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
+ xmlns:test="http://www.codesynthesis.com/xmlns/test"
+ targetNamespace="http://www.codesynthesis.com/xmlns/test">
+
+ <!-- attribute -->
+
+ <xsd:attribute name="attribute" type="xsd:IDREFS" xse:refType="test:a-author"/>
+
+ <xsd:complexType name="a-author">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:attribute name="recommends" type="xsd:IDREFS" xse:refType="test:a-author"/>
+ </xsd:complexType>
+
+
+ <!-- element -->
+
+ <xsd:element name="element" type="xsd:IDREFS" xse:refType="test:e-author"/>
+
+ <xsd:complexType name="e-author">
+ <xsd:sequence>
+ <xsd:element name="recommends" type="xsd:IDREFS" xse:refType="test:e-author"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- base -->
+
+ <xsd:simpleType name="author-refs">
+ <xsd:restriction base="xsd:IDREFS" xse:refType="test:e-author"/>
+ </xsd:simpleType>
+
+
+ <!-- itemType - illegal -->
+ <!--
+ <xsd:simpleType name="author-refss">
+ <xsd:list itemType="xsd:IDREFS" xse:refType="test:e-author"/>
+ </xsd:simpleType>
+ -->
+
+</xsd:schema>
diff --git a/xsd-tests/schema/ref-type/invalid-0.xsd b/xsd-tests/schema/ref-type/invalid-0.xsd
new file mode 100644
index 0000000..7ce82ed
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid-0.xsd
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
+ xmlns:test="http://www.codesynthesis.com/xmlns/test"
+ xmlns:phony="http://www.codesynthesis.com/xmlns/phony"
+ targetNamespace="http://www.codesynthesis.com/xmlns/test">
+
+ <!-- unresolvable namespace prefix -->
+
+ <xsd:attribute name="attribute1" type="xsd:IDREF" xse:refType="author"/>
+ <xsd:attribute name="attribute2" type="xsd:IDREF" xse:refType="t:author"/>
+
+ <!-- unresolvable namespace -->
+
+ <xsd:attribute name="attribute3" type="xsd:IDREF" xse:refType="phony:author"/>
+
+</xsd:schema>
diff --git a/xsd-tests/schema/ref-type/invalid-1.xsd b/xsd-tests/schema/ref-type/invalid-1.xsd
new file mode 100644
index 0000000..d989065
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid-1.xsd
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xse="http://www.codesynthesis.com/xmlns/xml-schema-extension"
+ xmlns:test="http://www.codesynthesis.com/xmlns/test"
+ targetNamespace="http://www.codesynthesis.com/xmlns/test">
+
+ <!-- unresolvable type -->
+
+ <xsd:attribute name="attribute" type="xsd:IDREF" xse:refType="test:author"/>
+
+</xsd:schema>