diff options
Diffstat (limited to 'xsd-examples/cxx/tree/custom/taxonomy')
-rw-r--r-- | xsd-examples/cxx/tree/custom/taxonomy/README | 34 | ||||
-rw-r--r-- | xsd-examples/cxx/tree/custom/taxonomy/buildfile | 4 |
2 files changed, 28 insertions, 10 deletions
diff --git a/xsd-examples/cxx/tree/custom/taxonomy/README b/xsd-examples/cxx/tree/custom/taxonomy/README index c2e425a..3296508 100644 --- a/xsd-examples/cxx/tree/custom/taxonomy/README +++ b/xsd-examples/cxx/tree/custom/taxonomy/README @@ -20,12 +20,24 @@ people.ixx people.cxx C++ types that represent the given vocabulary and a set of parsing functions that convert XML instance documents to a tree-like in-memory - object model. These are generated by XSD from people.xsd with the - --custom-type option in order to customize the person, superman, and + object model. + + These files are generated by the XSD compiler from people.xsd using the + following command line: + + xsd cxx-tree --generate-forward --generate-polymorphic \ + --polymorphic-type person \ + --custom-type "person=person_impl<person_base>/person_base" \ + --custom-type "superman=superman_impl<superman_base>/superman_base" \ + --custom-type "batman=batman_impl<batman_base>/batman_base" \ + --fwd-prologue '#include "people-custom-fwd.hxx"' \ + --hxx-prologue '#include "people-custom.hxx"' people.xsd + + The --custom-type option is used to customize the person, superman, and batman types. Generation of the people-fwd.hxx forward declaration - file is requested with the --generate-forward option. Note also that - we use the --generate-polymorphic command line option as well as - --polymorphic-type to mark the type hierarchy starting with the + file is requested with the --generate-forward option. Note also that + we use the --generate-polymorphic command line option as well as + --polymorphic-type to mark the type hierarchy starting with the person type as polymorphic. people-custom-fwd.hxx @@ -48,6 +60,14 @@ driver.cxx that constructs the object model from the input file. It then prints the database to STDERR. -To run the example on the sample XML instance document simply execute: +To compile and link the example manually from the command line we can use +the following commands (replace 'c++' with your C++ compiler name): + +c++ -c people.cxx +c++ -c people-custom.cxx +c++ -c driver.cxx +c++ -o driver driver.o people.o people-custom.o -lxerces-c + +To run the example on the sample XML instance document execute: -$ ./driver people.xml +./driver people.xml diff --git a/xsd-examples/cxx/tree/custom/taxonomy/buildfile b/xsd-examples/cxx/tree/custom/taxonomy/buildfile index 9267c68..4068daa 100644 --- a/xsd-examples/cxx/tree/custom/taxonomy/buildfile +++ b/xsd-examples/cxx/tree/custom/taxonomy/buildfile @@ -12,9 +12,7 @@ exe{driver}: xml{people}: test.input = true <{hxx ixx cxx}{people} hxx{people-fwd}>: xsd{people} $xsd {{ - diag xsd ($<[0]) # @@ TMP - - $xsd cxx-tree --std c++11 \ + $xsd cxx-tree \ --generate-inline \ --generate-forward \ --generate-polymorphic \ |