diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-18 18:48:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-01-13 22:32:43 +0300 |
commit | 2615896faa646e5830abf2c269150e1165c66515 (patch) | |
tree | 7d95978ec0a83094c9462ed4e1f59d42f4ff8ddb /xsd-tests/schema/attribute | |
parent | 7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff) |
Switch to build2
Diffstat (limited to 'xsd-tests/schema/attribute')
-rw-r--r-- | xsd-tests/schema/attribute/.gitignore | 3 | ||||
-rw-r--r-- | xsd-tests/schema/attribute/buildfile | 24 | ||||
-rw-r--r-- | xsd-tests/schema/attribute/driver.cxx | 11 | ||||
-rw-r--r-- | xsd-tests/schema/attribute/global.xsd | 21 | ||||
-rw-r--r-- | xsd-tests/schema/attribute/local.xsd | 37 | ||||
-rw-r--r-- | xsd-tests/schema/attribute/ref.xsd | 42 |
6 files changed, 138 insertions, 0 deletions
diff --git a/xsd-tests/schema/attribute/.gitignore b/xsd-tests/schema/attribute/.gitignore new file mode 100644 index 0000000..88cd012 --- /dev/null +++ b/xsd-tests/schema/attribute/.gitignore @@ -0,0 +1,3 @@ +global.?xx +local.?xx +ref.?xx diff --git a/xsd-tests/schema/attribute/buildfile b/xsd-tests/schema/attribute/buildfile new file mode 100644 index 0000000..0f97923 --- /dev/null +++ b/xsd-tests/schema/attribute/buildfile @@ -0,0 +1,24 @@ +# file : schema/attribute/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = global local ref + +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/attribute/driver.cxx b/xsd-tests/schema/attribute/driver.cxx new file mode 100644 index 0000000..3d29b36 --- /dev/null +++ b/xsd-tests/schema/attribute/driver.cxx @@ -0,0 +1,11 @@ +// file : schema/attribute/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "ref.hxx" +#include "global.hxx" +#include "local.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/attribute/global.xsd b/xsd-tests/schema/attribute/global.xsd new file mode 100644 index 0000000..e2dcc93 --- /dev/null +++ b/xsd-tests/schema/attribute/global.xsd @@ -0,0 +1,21 @@ +<?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"> + + <!-- Typed with named type. --> + + <xsd:attribute name="foo" type="xsd:string"/> + + + <!-- Typed with anonymous type. --> + + <xsd:attribute name="bar"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + </xsd:attribute> + +</xsd:schema> diff --git a/xsd-tests/schema/attribute/local.xsd b/xsd-tests/schema/attribute/local.xsd new file mode 100644 index 0000000..7a7a480 --- /dev/null +++ b/xsd-tests/schema/attribute/local.xsd @@ -0,0 +1,37 @@ +<?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"> + + + <!-- Typed with named type. --> + + <xsd:complexType name="Foo"> + <xsd:attribute name="foo" type="xsd:string"/> + </xsd:complexType> + + + <!-- Forward reference to a yet undeclared type. --> + + <xsd:complexType name="Bar"> + <xsd:attribute name="bar" type="Bar2"/> + </xsd:complexType> + + <xsd:simpleType name="Bar2"> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + + + <!-- Typed with anonymous type. --> + + <xsd:complexType name="Baz"> + <xsd:attribute name="baz"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + +</xsd:schema> diff --git a/xsd-tests/schema/attribute/ref.xsd b/xsd-tests/schema/attribute/ref.xsd new file mode 100644 index 0000000..d806ff3 --- /dev/null +++ b/xsd-tests/schema/attribute/ref.xsd @@ -0,0 +1,42 @@ +<?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"> + + + <!-- Easy case. --> + + <xsd:attribute name="foo" type="xsd:string"/> + + <xsd:complexType name="Foo2"> + <xsd:attribute ref="foo"/> + </xsd:complexType> + + + + <!-- Forward reference to a yet undeclared attribute. --> + + <xsd:complexType name="Bar3"> + <xsd:attribute ref="bar"/> + </xsd:complexType> + + <xsd:attribute name="bar" type="xsd:string"/> + + + + <!-- Reference to an attribute with a forward reference to a yet + undeclared type. --> + + <xsd:attribute name="baz" type="Baz2"/> + + <xsd:complexType name="Baz3"> + <xsd:attribute ref="baz"/> + </xsd:complexType> + + <xsd:simpleType name="Baz2"> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + +</xsd:schema> |