summaryrefslogtreecommitdiff
path: root/xsd-examples/cxx/tree/order
diff options
context:
space:
mode:
Diffstat (limited to 'xsd-examples/cxx/tree/order')
-rw-r--r--xsd-examples/cxx/tree/order/element/README34
-rw-r--r--xsd-examples/cxx/tree/order/element/buildfile4
-rw-r--r--xsd-examples/cxx/tree/order/mixed/README25
-rw-r--r--xsd-examples/cxx/tree/order/mixed/buildfile4
4 files changed, 46 insertions, 21 deletions
diff --git a/xsd-examples/cxx/tree/order/element/README b/xsd-examples/cxx/tree/order/element/README
index 19f2381..bd6d0c9 100644
--- a/xsd-examples/cxx/tree/order/element/README
+++ b/xsd-examples/cxx/tree/order/element/README
@@ -8,18 +8,24 @@ transactions.xsd
transactions can contain any number of different transactions in
any order but the order of transaction in the batch is significant.
-library.xml
+transactions.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.
+ parsing and serialization functions.
+
+ These files are generated by the XSD compiler from transactions.xsd
+ using the following command line:
+
+ xsd cxx-tree --generate-serialization --generate-wildcard \
+ --ordered-type batch 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
@@ -30,6 +36,16 @@ driver.cxx
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:
+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 transactions.cxx
+c++ -DXSD_CXX11 -c driver.cxx
+c++ -o driver driver.o transactions.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 transactions.xml
+./driver transactions.xml
diff --git a/xsd-examples/cxx/tree/order/element/buildfile b/xsd-examples/cxx/tree/order/element/buildfile
index eb3834e..6e56a60 100644
--- a/xsd-examples/cxx/tree/order/element/buildfile
+++ b/xsd-examples/cxx/tree/order/element/buildfile
@@ -12,9 +12,7 @@ exe{driver}: xml{transactions}: test.input = true
<{hxx ixx cxx}{transactions}>: xsd{transactions} $xsd
{{
- diag xsd ($<[0]) # @@ TMP
-
- $xsd cxx-tree --std c++11 \
+ $xsd cxx-tree \
--generate-inline \
--generate-serialization \
--generate-wildcard \
diff --git a/xsd-examples/cxx/tree/order/mixed/README b/xsd-examples/cxx/tree/order/mixed/README
index e66c1ad..bc209f6 100644
--- a/xsd-examples/cxx/tree/order/mixed/README
+++ b/xsd-examples/cxx/tree/order/mixed/README
@@ -25,10 +25,16 @@ text.xml
text.hxx
text.cxx
C++ types that represent the given vocabulary as well as a set of
- parsing and serialization functions. These are generated by XSD
- from text.xsd. Note that the --ordered-type-mixed option is used
- to indicate to the XSD compiler that all types with mixed content
- should be automatically treated as ordered.
+ parsing and serialization functions.
+
+ These files are generated by the XSD compiler from text.xsd using the
+ following command line:
+
+ xsd cxx-tree --generate-serialization --ordered-type-mixed text.xsd
+
+ Note that the --ordered-type-mixed option is used to indicate to the XSD
+ compiler that all types with mixed content should be automatically treated
+ as ordered.
driver.cxx
Driver for the example. It first calls one of the parsing functions
@@ -40,6 +46,13 @@ driver.cxx
text 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:
+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++ -c text.cxx
+c++ -c driver.cxx
+c++ -o driver driver.o text.o -lxerces-c
+
+To run the example on the sample XML instance document execute:
-$ ./driver text.xml
+./driver text.xml
diff --git a/xsd-examples/cxx/tree/order/mixed/buildfile b/xsd-examples/cxx/tree/order/mixed/buildfile
index 149bca0..6bc21e2 100644
--- a/xsd-examples/cxx/tree/order/mixed/buildfile
+++ b/xsd-examples/cxx/tree/order/mixed/buildfile
@@ -12,9 +12,7 @@ exe{driver}: xml{text}: test.input = true
<{hxx ixx cxx}{text}>: xsd{text} $xsd
{{
- diag xsd ($<[0]) # @@ TMP
-
- $xsd cxx-tree --std c++11 \
+ $xsd cxx-tree \
--generate-inline \
--generate-serialization \
--ordered-type-mixed \