diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-09-26 10:43:31 +0200 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-09-27 15:13:24 +0300 |
commit | 741bfb659caaa771c748d03df26792fab10e5778 (patch) | |
tree | db562df317a95507f8d66fdd63916cf198b95ec2 /xsd-examples/cxx/tree/streaming | |
parent | 38d7c2a86cce70436ad359a62c603d64710e8471 (diff) |
Add XSD and C++ compiler command lines to example READMEs
Diffstat (limited to 'xsd-examples/cxx/tree/streaming')
-rw-r--r-- | xsd-examples/cxx/tree/streaming/.gitignore | 1 | ||||
-rw-r--r-- | xsd-examples/cxx/tree/streaming/README | 26 |
2 files changed, 23 insertions, 4 deletions
diff --git a/xsd-examples/cxx/tree/streaming/.gitignore b/xsd-examples/cxx/tree/streaming/.gitignore index db4a6e9..d2232b3 100644 --- a/xsd-examples/cxx/tree/streaming/.gitignore +++ b/xsd-examples/cxx/tree/streaming/.gitignore @@ -1 +1,2 @@ position.?xx +out.xml diff --git a/xsd-examples/cxx/tree/streaming/README b/xsd-examples/cxx/tree/streaming/README index 5a467e0..23d3a7f 100644 --- a/xsd-examples/cxx/tree/streaming/README +++ b/xsd-examples/cxx/tree/streaming/README @@ -18,8 +18,12 @@ position.xml position.hxx position.cxx C++ types that represent the position vocabulary as well as parsing - and serialization functions. These are generated by XSD from - position.xsd. + and serialization functions. + + These files are generated by the XSD compiler from position.xsd using + the following command line: + + xsd cxx-tree --generate-serialization position.xsd parser.hxx parser.cxx @@ -44,8 +48,22 @@ driver.cxx It also serializes the object model fragments into a new XML document (out.xml). -To run the example 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 position.cxx +c++ -DXSD_CXX11 -c parser.cxx +c++ -DXSD_CXX11 -c serializer.cxx +c++ -DXSD_CXX11 -c grammar-input-stream.cxx +c++ -DXSD_CXX11 -c driver.cxx +c++ -o driver driver.o position.o parser.o serializer.o \ + grammar-input-stream.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 position.xml +./driver position.xml The serialization results are written to the out.xml file. |