summaryrefslogtreecommitdiff
path: root/xsd-examples/cxx/tree/polymorphism
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-09-26 10:43:31 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-27 15:13:24 +0300
commit741bfb659caaa771c748d03df26792fab10e5778 (patch)
treedb562df317a95507f8d66fdd63916cf198b95ec2 /xsd-examples/cxx/tree/polymorphism
parent38d7c2a86cce70436ad359a62c603d64710e8471 (diff)
Add XSD and C++ compiler command lines to example READMEs
Diffstat (limited to 'xsd-examples/cxx/tree/polymorphism')
-rw-r--r--xsd-examples/cxx/tree/polymorphism/README22
1 files changed, 18 insertions, 4 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