diff options
Diffstat (limited to 'xsd-examples/cxx/tree/wildcard/README')
-rw-r--r-- | xsd-examples/cxx/tree/wildcard/README | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/xsd-examples/cxx/tree/wildcard/README b/xsd-examples/cxx/tree/wildcard/README new file mode 100644 index 0000000..8b89774 --- /dev/null +++ b/xsd-examples/cxx/tree/wildcard/README @@ -0,0 +1,51 @@ +This example shows how to use the optional wildcard mapping provided +by C++/Tree to parse, access, modify, and serialize the XML data +matched by XML Schema wildcards (any and anyAttribute). For an +alternative approach that employes type customization see the +custom/wildcard example. + +The example consists of the following files: + +email.xsd + XML Schema which describes a simple email format with the + extensible envelope type. + +email.xml + Sample email message. + +email.hxx +email.ixx +email.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 files are generated by the XSD compiler from email.xsd using the + following command line: + + xsd cxx-tree --generate-wildcard --generate-serialization \ + --root-element message email.xsd + + Note that the --generate-wildcard option is used to request the + wildcard mapping. + +driver.cxx + Driver for the example. It first calls one of the parsing functions + that constructs the object model from the input file. It then prints + the content of the object model to STDERR. Next the driver creates a + reply email which is then serialized to XML. + +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 email.cxx +c++ -DXSD_CXX11 -c driver.cxx +c++ -o driver driver.o email.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 email.xml |