From 707cc94fe52463870a9c6c8e2e66eaaa389e601d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 24 Feb 2009 15:16:26 +0200 Subject: Start tracking XSD/e with git after version 3.0.0 --- examples/cxx/hybrid/multiroot/README | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 examples/cxx/hybrid/multiroot/README (limited to 'examples/cxx/hybrid/multiroot/README') diff --git a/examples/cxx/hybrid/multiroot/README b/examples/cxx/hybrid/multiroot/README new file mode 100644 index 0000000..3a7cfae --- /dev/null +++ b/examples/cxx/hybrid/multiroot/README @@ -0,0 +1,48 @@ +This example shows how to parse XML vocabularies with multiple root +elements using the Embedded C++/Hybrid mapping. + +The example consists of the following files: + +protocol.xsd + XML Schema which defines a simple bank account protocol with + requests such as withdraw and deposit. + +balance.xml +withdraw.xml +deposit.xml + Sample XML instances for the protocol requests. + +protocol.hxx +protocol.cxx + +protocol-pskel.hxx +protocol-pskel.cxx +protocol-pimpl.hxx +protocol-pimpl.cxx + Object model (the first pair of files), parser skeletons (the + second pair) and parser implementations (the third pair). These + files are generated by the XSD/e compiler from protocol.xsd. The + --generate-parser and --generate-aggregate options were used to + request the generation of the parsing code. + +driver.cxx + Driver for the example. It implements a custom document parser + that determines which request is being parsed and uses the + corresponding parser implementation. The document parser + intentionally does not support the deposit request to show how + to handle unknown documents. The driver first calls the parser + that constructs the object model from the input XML file. It + then prints the content of the object model to STDERR. + +To run the example on the sample XML request documents simply +execute: + +$ ./driver balance.xml +$ ./driver withdraw.xml +$ ./driver deposit.xml + +The example reads from STDIN if input file is not specified: + +$ ./driver