diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-18 18:48:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-02-24 22:20:33 +0300 |
commit | a8ce5c380c69539fe0c7c62c397634d9d0c9fde2 (patch) | |
tree | c8db5c9b99416ca4686af953387f474af15bc92e /xsd-tests/schema/import | |
parent | 7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff) |
Switch to build2
Diffstat (limited to 'xsd-tests/schema/import')
-rw-r--r-- | xsd-tests/schema/import/.gitignore | 1 | ||||
-rw-r--r-- | xsd-tests/schema/import/buildfile | 27 | ||||
-rw-r--r-- | xsd-tests/schema/import/driver.cxx | 9 | ||||
-rw-r--r-- | xsd-tests/schema/import/importer.xsd | 20 | ||||
-rw-r--r-- | xsd-tests/schema/import/schemas/.gitignore | 1 | ||||
-rw-r--r-- | xsd-tests/schema/import/schemas/importee.xsd | 15 |
6 files changed, 73 insertions, 0 deletions
diff --git a/xsd-tests/schema/import/.gitignore b/xsd-tests/schema/import/.gitignore new file mode 100644 index 0000000..6cdf6db --- /dev/null +++ b/xsd-tests/schema/import/.gitignore @@ -0,0 +1 @@ +importer.?xx diff --git a/xsd-tests/schema/import/buildfile b/xsd-tests/schema/import/buildfile new file mode 100644 index 0000000..9e6aec5 --- /dev/null +++ b/xsd-tests/schema/import/buildfile @@ -0,0 +1,27 @@ +# file : schema/import/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 = importer schemas/importee + +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 $directory($path($>[0])) \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/import/driver.cxx b/xsd-tests/schema/import/driver.cxx new file mode 100644 index 0000000..a94b2f3 --- /dev/null +++ b/xsd-tests/schema/import/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/import/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "importer.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/import/importer.xsd b/xsd-tests/schema/import/importer.xsd new file mode 100644 index 0000000..82fc33c --- /dev/null +++ b/xsd-tests/schema/import/importer.xsd @@ -0,0 +1,20 @@ +<?xml version="1.0" ?> +<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:Test="http://www.codesynthesis.com/xmlns/test" + xmlns:Impl="http://www.codesynthesis.com/xmlns/test/impl" + targetNamespace="http://www.codesynthesis.com/xmlns/test/impl"> + + <!-- <xsd::element name="foo" type="xsd:string"/> --> + + <xsd:import namespace="http://www.codesynthesis.com/xmlns/test" schemaLocation="schemas/importee.xsd"/> + + <xsd:simpleType name="derived"> + <xsd:restriction base="Test:base"/> + </xsd:simpleType> + + <xsd:element name="element" type="Test:base"/> + <xsd:attribute name="attribute" type="Test:base"/> + +</xsd:schema> diff --git a/xsd-tests/schema/import/schemas/.gitignore b/xsd-tests/schema/import/schemas/.gitignore new file mode 100644 index 0000000..945fcfc --- /dev/null +++ b/xsd-tests/schema/import/schemas/.gitignore @@ -0,0 +1 @@ +importee.?xx diff --git a/xsd-tests/schema/import/schemas/importee.xsd b/xsd-tests/schema/import/schemas/importee.xsd new file mode 100644 index 0000000..9b03315 --- /dev/null +++ b/xsd-tests/schema/import/schemas/importee.xsd @@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<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:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + + <xsd:simpleType name="base"> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + + <xsd:element name="base_e" type="test:base"/> + +</xsd:schema> |