diff options
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 | ||||
-rw-r--r-- | xsd-examples/cxx/tree/streaming/buildfile | 4 |
3 files changed, 24 insertions, 7 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. diff --git a/xsd-examples/cxx/tree/streaming/buildfile b/xsd-examples/cxx/tree/streaming/buildfile index 8c34b17..8555257 100644 --- a/xsd-examples/cxx/tree/streaming/buildfile +++ b/xsd-examples/cxx/tree/streaming/buildfile @@ -10,9 +10,7 @@ exe{driver}: {hxx cxx}{* -position} {hxx ixx cxx}{position} $libs testscript <{hxx ixx cxx}{position}>: xsd{position} $xsd {{ - diag xsd ($<[0]) # @@ TMP - - $xsd cxx-tree --std c++11 \ + $xsd cxx-tree \ --generate-inline \ --generate-serialization \ --output-dir $out_base \ |