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/caching/README | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'xsd-examples/cxx/tree/caching/README') diff --git a/xsd-examples/cxx/tree/caching/README b/xsd-examples/cxx/tree/caching/README index 64dffb3..1672d6f 100644 --- a/xsd-examples/cxx/tree/caching/README +++ b/xsd-examples/cxx/tree/caching/README @@ -14,7 +14,12 @@ library.hxx library.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 library.xsd. + object model. + + These files are generated by the XSD compiler from library.xsd using + the following command line: + + xsd cxx-tree library.xsd driver.cxx Driver for the example. It first sets up the Xerces-C++ DOM parser @@ -24,6 +29,16 @@ driver.cxx the object model from this DOM document. On each iteration the driver prints a number of books in the object model 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++ -DXSD_CXX11 -c library.cxx +c++ -DXSD_CXX11 -c driver.cxx +c++ -o driver driver.o library.o -lxerces-c + +Note that we need to define the XSD_CXX11 preprocessor macro since the +source code includes libxsd headers directly. + +To run the example on the sample XML instance document execute: -$ ./driver library.xml library.xsd +./driver library.xml library.xsd -- cgit v1.1