blob: d4515090e6745c3a524578f0cc5c539c98af2c7f (plain
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
The example consists of the following files:
XML Schema which describes a simple email format with the
extensible envelope type.
Sample email message.
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 are generated by XSD from email.xsd.
Note that the --generate-wildcard option is used to request the
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 run the example on the sample XML instance document simply execute:
$ ./driver email.xml