summaryrefslogtreecommitdiff
path: root/xsd-tests/schema/ref-type/invalid
diff options
context:
space:
mode:
Diffstat (limited to 'xsd-tests/schema/ref-type/invalid')
-rw-r--r--xsd-tests/schema/ref-type/invalid/buildfile12
-rw-r--r--xsd-tests/schema/ref-type/invalid/invalid-0.xsd17
-rw-r--r--xsd-tests/schema/ref-type/invalid/invalid-1.xsd11
-rw-r--r--xsd-tests/schema/ref-type/invalid/testscript16
4 files changed, 56 insertions, 0 deletions
diff --git a/xsd-tests/schema/ref-type/invalid/buildfile b/xsd-tests/schema/ref-type/invalid/buildfile
new file mode 100644
index 0000000..42c7bfb
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid/buildfile
@@ -0,0 +1,12 @@
+# file : schema/ref-type/invalid/buildfile
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+# Test that the invalid schema files compilation expectedly fails.
+#
+./: testscript xsd{*} $xsd
+
+testscript{*}:
+{
+ test = $xsd
+ test.arguments = cxx-tree --std c++11
+}
diff --git a/xsd-tests/schema/ref-type/invalid/invalid-0.xsd b/xsd-tests/schema/ref-type/invalid/invalid-0.xsd
new file mode 100644
index 0000000..7ce82ed
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid/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/invalid-1.xsd b/xsd-tests/schema/ref-type/invalid/invalid-1.xsd
new file mode 100644
index 0000000..d989065
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid/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>
diff --git a/xsd-tests/schema/ref-type/invalid/testscript b/xsd-tests/schema/ref-type/invalid/testscript
new file mode 100644
index 0000000..ce2e049
--- /dev/null
+++ b/xsd-tests/schema/ref-type/invalid/testscript
@@ -0,0 +1,16 @@
+# file : schema/ref-type/invalid/testscript
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+: unresolvable-namespace-prefix
+:
+$* --output-dir $~ $src_base/invalid-0.xsd 2>>~%EOE%d != 0
+ %\.+invalid-0.xsd:10:75: error: unable to resolve namespace ''%
+ %\.+invalid-0.xsd:11:77: error: unable to resolve namespace prefix 't' in 't:author'%
+ %\.+invalid-0.xsd:15:81: error: unable to resolve namespace 'http://www.codesynthesis.com/xmlns/phony'%
+ EOE
+
+: unresolvable-type
+:
+$* --output-dir $~ $src_base/invalid-1.xsd 2>>~%EOE%d != 0
+ %\.+invalid-1.xsd:9:79: error: unable to resolve type 'author' in namespace 'http://www.codesynthesis.com/xmlns/test'%
+ EOE