summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/order/element/README
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-04-10 12:57:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-04-10 12:57:06 +0200
commit884dea7531962b17ef843ac2175faa050e8b0758 (patch)
treed70950ab2a6f314b06f37faa67252678ce3007b1 /examples/cxx/tree/order/element/README
parent0f6ff689dc6bae8fed94da0fcabd39f015e7a62b (diff)
Add support for ordered types, mixed content
Diffstat (limited to 'examples/cxx/tree/order/element/README')
-rw-r--r--examples/cxx/tree/order/element/README35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/cxx/tree/order/element/README b/examples/cxx/tree/order/element/README
new file mode 100644
index 0000000..19f2381
--- /dev/null
+++ b/examples/cxx/tree/order/element/README
@@ -0,0 +1,35 @@
+This example shows how to use ordered types to capture and maintain
+element order, including element wildcards.
+
+The example consists of the following files:
+
+transactions.xsd
+ XML Schema which describes various bank transactions. A batch of
+ transactions can contain any number of different transactions in
+ any order but the order of transaction in the batch is significant.
+
+library.xml
+ Sample XML instance document.
+
+transactions.hxx
+transactions.cxx
+ C++ types that represent the given vocabulary as well as a set of
+ parsing and serialization functions. These are generated by XSD
+ from transactions.xsd. Note that the --ordered-type option is
+ used to indicate to the XSD compiler that the batch type is
+ ordered. We also use the --generate-wildcard option to enable
+ wildcard support. An element wildcard is used in the batch to
+ allow transaction extensions.
+
+driver.cxx
+ Driver for the example. It first calls one of the parsing functions
+ that constructs the object model from the input XML file. It then
+ iterates over transactions in the batch using the content order
+ sequence. The driver then performs various modifications of the
+ object model while showing how to maintain the content order.
+ Finally, it saves the modified transaction batch back to XML to
+ verify that the content order is preserved in the output document.
+
+To run the example on the sample XML instance document simply execute:
+
+$ ./driver transactions.xml