summaryrefslogtreecommitdiff
path: root/xsd-tests/schema/attribute-group
diff options
context:
space:
mode:
Diffstat (limited to 'xsd-tests/schema/attribute-group')
-rw-r--r--xsd-tests/schema/attribute-group/.gitignore1
-rw-r--r--xsd-tests/schema/attribute-group/buildfile22
-rw-r--r--xsd-tests/schema/attribute-group/driver.cxx9
-rw-r--r--xsd-tests/schema/attribute-group/global.xsd50
4 files changed, 82 insertions, 0 deletions
diff --git a/xsd-tests/schema/attribute-group/.gitignore b/xsd-tests/schema/attribute-group/.gitignore
new file mode 100644
index 0000000..a935c30
--- /dev/null
+++ b/xsd-tests/schema/attribute-group/.gitignore
@@ -0,0 +1 @@
+global.?xx
diff --git a/xsd-tests/schema/attribute-group/buildfile b/xsd-tests/schema/attribute-group/buildfile
new file mode 100644
index 0000000..b9ca83b
--- /dev/null
+++ b/xsd-tests/schema/attribute-group/buildfile
@@ -0,0 +1,22 @@
+# file : schema/attribute-group/buildfile
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+# Just make sure that the schema files and the xsd-generated C++ mappings are
+# compilable.
+#
+import libs = libxsd%lib{xsd}
+import libs += libxerces-c%lib{xerces-c}
+
+exe{driver}: {hxx cxx}{* -global} {hxx cxx}{global} $libs
+
+<{hxx cxx}{global}>: xsd{global} $xsd
+{{
+ diag xsd ($<[0]) # @@ TMP
+
+ $xsd cxx-tree --std c++11 \
+ --root-element-all \
+ --output-dir $out_base \
+ $path($<[0])
+}}
+
+cxx.poptions =+ "-I$out_base"
diff --git a/xsd-tests/schema/attribute-group/driver.cxx b/xsd-tests/schema/attribute-group/driver.cxx
new file mode 100644
index 0000000..328cef4
--- /dev/null
+++ b/xsd-tests/schema/attribute-group/driver.cxx
@@ -0,0 +1,9 @@
+// file : schema/attribute-group/driver.cxx
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#include "global.hxx"
+
+int
+main (int, char*[])
+{
+}
diff --git a/xsd-tests/schema/attribute-group/global.xsd b/xsd-tests/schema/attribute-group/global.xsd
new file mode 100644
index 0000000..6ee0539
--- /dev/null
+++ b/xsd-tests/schema/attribute-group/global.xsd
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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="http://www.codesynthesis.com/xmlns/test"
+ targetNamespace="http://www.codesynthesis.com/xmlns/test">
+
+ <!-- Simple case. -->
+
+ <xsd:attributeGroup name="gfoo_1">
+ <xsd:attribute name="foo_1_1" type="xsd:string"/>
+ <xsd:attribute name="foo_1_2" type="xsd:string"/>
+ </xsd:attributeGroup>
+
+ <xsd:attributeGroup name="gfoo_2">
+ <xsd:attributeGroup ref="gfoo_1"/>
+ <xsd:attribute name="foo_2_1" type="xsd:string"/>
+ <xsd:attribute name="foo_2_2" type="xsd:string"/>
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="Foo">
+ <xsd:attributeGroup ref="gfoo_2"/>
+ </xsd:complexType>
+
+
+
+ <!-- Forward reference. -->
+
+ <xsd:attributeGroup name="gbar_3">
+ <xsd:attribute name="bar_3_1" type="xsd:string"/>
+ <xsd:attribute name="bar_3_2" type="xsd:string"/>
+ <xsd:attributeGroup ref="gbar_1"/>
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="Bar">
+ <xsd:attributeGroup ref="gbar_2"/>
+ </xsd:complexType>
+
+ <xsd:attributeGroup name="gbar_2">
+ <xsd:attributeGroup ref="gbar_3"/>
+ <xsd:attribute name="bar_2_1" type="xsd:string"/>
+ <xsd:attribute name="bar_2_2" type="xsd:string"/>
+ </xsd:attributeGroup>
+
+ <xsd:attributeGroup name="gbar_1">
+ <xsd:attribute name="bar_1_1" type="xsd:string"/>
+ <xsd:attribute name="bar_1_2" type="xsd:string"/>
+ </xsd:attributeGroup>
+
+</xsd:schema>