diff options
Diffstat (limited to 'xsd-tests/clash')
-rw-r--r-- | xsd-tests/clash/.gitignore | 2 | ||||
-rw-r--r-- | xsd-tests/clash/buildfile | 27 | ||||
-rw-r--r-- | xsd-tests/clash/clash.xsd | 25 | ||||
-rw-r--r-- | xsd-tests/clash/driver.cxx | 10 | ||||
-rw-r--r-- | xsd-tests/clash/foo.xsd | 11 |
5 files changed, 75 insertions, 0 deletions
diff --git a/xsd-tests/clash/.gitignore b/xsd-tests/clash/.gitignore new file mode 100644 index 0000000..7349df1 --- /dev/null +++ b/xsd-tests/clash/.gitignore @@ -0,0 +1,2 @@ +clash.?xx +foo.?xx diff --git a/xsd-tests/clash/buildfile b/xsd-tests/clash/buildfile new file mode 100644 index 0000000..e99dccf --- /dev/null +++ b/xsd-tests/clash/buildfile @@ -0,0 +1,27 @@ +# file : clash/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} + +fs = foo clash + +exe{driver}: {hxx cxx}{* -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $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/clash/clash.xsd b/xsd-tests/clash/clash.xsd new file mode 100644 index 0000000..8458908 --- /dev/null +++ b/xsd-tests/clash/clash.xsd @@ -0,0 +1,25 @@ +<?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/bar" + xmlns:f="http://www.codesynthesis.com/xmlns/test/foo" + targetNamespace="http://www.codesynthesis.com/xmlns/test/bar"> + + <xsd:import namespace="http://www.codesynthesis.com/xmlns/test/foo" schemaLocation="foo.xsd"/> + + <!-- example of a name clash. --> + + <xsd:element name="foo" type="xsd:string"/> + + <xsd:complexType name="Foo"> + <xsd:sequence> + <xsd:element ref="foo"/> + <xsd:element name="foo" type="xsd:long"/> + <xsd:element ref="f:foo"/> + <xsd:element ref="f:foo"/> + </xsd:sequence> + <xsd:attribute name="foo" type="xsd:string"/> + </xsd:complexType> + +</xsd:schema> diff --git a/xsd-tests/clash/driver.cxx b/xsd-tests/clash/driver.cxx new file mode 100644 index 0000000..478e71a --- /dev/null +++ b/xsd-tests/clash/driver.cxx @@ -0,0 +1,10 @@ +// file : clash/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "foo.hxx" +#include "clash.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/clash/foo.xsd b/xsd-tests/clash/foo.xsd new file mode 100644 index 0000000..8a06ba8 --- /dev/null +++ b/xsd-tests/clash/foo.xsd @@ -0,0 +1,11 @@ +<?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/foo" + targetNamespace="http://www.codesynthesis.com/xmlns/test/foo"> + + <xsd:element name="foo" type="xsd:int"/> + <xsd:element name="bar" type="xsd:int"/> + +</xsd:schema> |