diff options
Diffstat (limited to 'xsd-examples/cxx/tree/polymorphism')
-rw-r--r-- | xsd-examples/cxx/tree/polymorphism/README | 22 | ||||
-rw-r--r-- | xsd-examples/cxx/tree/polymorphism/buildfile | 4 |
2 files changed, 19 insertions, 7 deletions
diff --git a/xsd-examples/cxx/tree/polymorphism/README b/xsd-examples/cxx/tree/polymorphism/README index 6e54e49..368ddd0 100644 --- a/xsd-examples/cxx/tree/polymorphism/README +++ b/xsd-examples/cxx/tree/polymorphism/README @@ -14,9 +14,16 @@ supermen.cxx C++ types that represent the given vocabulary, a set of parsing functions that convert XML instance documents to a tree-like in-memory object model, and a set of serialization functions that convert the - object model back to XML. These are generated by XSD from supermen.xsd. + object model back to XML. + + These files are generated by the XSD compiler from supermen.xsd using + the following command line: + + xsd cxx-tree --generate-polymorphic --generate-serialization \ + --root-element-last supermen.xsd + Note also that we use the --generate-polymorphic command line option - and that we don't need to use --polymorphic-type to explicitly mark + and that we don't need to use --polymorphic-type to explicitly mark types as polymorphic because this is automatically deduced by the XSD compiler from the substitution groups used in the supermen.xsd schema. @@ -27,6 +34,13 @@ driver.cxx the content of the object model to STDERR. Finally, the driver serializes the object model back to XML. -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 supermen.cxx +c++ -c driver.cxx +c++ -o driver driver.o supermen.o -lxerces-c + +To run the example on the sample XML instance document execute: -$ ./driver instance.xml +./driver supermen.xml diff --git a/xsd-examples/cxx/tree/polymorphism/buildfile b/xsd-examples/cxx/tree/polymorphism/buildfile index 754c6c2..359d4d3 100644 --- a/xsd-examples/cxx/tree/polymorphism/buildfile +++ b/xsd-examples/cxx/tree/polymorphism/buildfile @@ -12,9 +12,7 @@ exe{driver}: xml{supermen}: test.input = true <{hxx ixx cxx}{supermen}>: xsd{supermen} $xsd {{ - diag xsd ($<[0]) # @@ TMP - - $xsd cxx-tree --std c++11 \ + $xsd cxx-tree \ --generate-inline \ --generate-polymorphic \ --generate-serialization \ |