README
1This example shows how to use XML Schema polymorphism features such as
2xsi:type attributes and substitution groups in the C++/Tree mapping.
3
4The example consists of the following files:
5
6supermen.xsd
7 XML Schema which describes the "supermen" instance documents.
8
9supermen.xml
10 Sample XML instance document.
11
12supermen.hxx
13supermen.cxx
14 C++ types that represent the given vocabulary, a set of parsing
15 functions that convert XML instance documents to a tree-like in-memory
16 object model, and a set of serialization functions that convert the
17 object model back to XML. These are generated by XSD from supermen.xsd.
18 Note also that we use the --generate-polymorphic command line option
19 and that we don't need to use --polymorphic-type to explicitly mark
20 types as polymorphic because this is automatically deduced by the
21 XSD compiler from the substitution groups used in the supermen.xsd
22 schema.
23
24driver.cxx
25 Driver for the example. It first calls one of the parsing functions
26 that constructs the object model from the input file. It then prints
27 the content of the object model to STDERR. Finally, the driver serializes
28 the object model back to XML.
29
30To run the example on the sample XML instance document simply execute:
31
32$ ./driver instance.xml
33