From 741bfb659caaa771c748d03df26792fab10e5778 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Sep 2023 10:43:31 +0200 Subject: Add XSD and C++ compiler command lines to example READMEs --- xsd-examples/cxx/tree/custom/wildcard/README | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'xsd-examples/cxx/tree/custom/wildcard') diff --git a/xsd-examples/cxx/tree/custom/wildcard/README b/xsd-examples/cxx/tree/custom/wildcard/README index 70eaea4..8b5b2f0 100644 --- a/xsd-examples/cxx/tree/custom/wildcard/README +++ b/xsd-examples/cxx/tree/custom/wildcard/README @@ -23,8 +23,16 @@ wildcard.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 wildcard.xsd - with the --custom-type option in order to customize the data type. + object model back to XML. + + These files are generated by the XSD compiler from wildcard.xsd using + the following command line: + + xsd cxx-tree --generate-serialization --generate-ostream \ + --custom-type data=/data_base \ + --hxx-epilogue '#include "wildcard-custom.hxx"' wildcard.xsd + + The --custom-type option is used to customize the data type. wildcard-custom.hxx Header file which defines our own data class by inheriting from the @@ -40,6 +48,14 @@ driver.cxx the data to STDERR, including the extra attribute. 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 wildcard.cxx +c++ -c wildcard-custom.cxx +c++ -c driver.cxx +c++ -o driver driver.o wildcard.o wildcard-custom.o -lxerces-c + +To run the example on the sample XML instance document execute: -$ ./driver wildcard.xml +./driver wildcard.xml -- cgit v1.1