summaryrefslogtreecommitdiff
path: root/xsd/examples/cxx/tree/mixed
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/examples/cxx/tree/mixed')
-rw-r--r--xsd/examples/cxx/tree/mixed/README6
-rw-r--r--xsd/examples/cxx/tree/mixed/driver.cxx9
-rw-r--r--xsd/examples/cxx/tree/mixed/makefile10
-rw-r--r--xsd/examples/cxx/tree/mixed/text.xml3
-rw-r--r--xsd/examples/cxx/tree/mixed/text.xsd1
5 files changed, 15 insertions, 14 deletions
diff --git a/xsd/examples/cxx/tree/mixed/README b/xsd/examples/cxx/tree/mixed/README
index 9ab3309..fc23faa 100644
--- a/xsd/examples/cxx/tree/mixed/README
+++ b/xsd/examples/cxx/tree/mixed/README
@@ -1,8 +1,12 @@
This example shows how to access the underlying DOM nodes in the
C++/Tree mapping in order to handle raw, "type-less content" such
as mixed content models, anyType/anySimpleType, and any/anyAttribute.
+
+For an alternative (and recommended) approach that employs ordered
+types see the order/mixed example.
+
For an alternative approach that employes type customization see
-examples in the custom/ directory, in particular, custom/mixed and
+examples in the custom/ directory, in particular, custom/mixed and
custom/wildcard.
In this example we use mixed content model to describe text with
diff --git a/xsd/examples/cxx/tree/mixed/driver.cxx b/xsd/examples/cxx/tree/mixed/driver.cxx
index d905421..17c3b55 100644
--- a/xsd/examples/cxx/tree/mixed/driver.cxx
+++ b/xsd/examples/cxx/tree/mixed/driver.cxx
@@ -1,5 +1,4 @@
// file : examples/cxx/tree/mixed/driver.cxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain
#include <memory> // std::auto_ptr
@@ -47,10 +46,12 @@ main (int argc, char* argv[])
xml_schema::flags::keep_dom |
xml_schema::flags::dont_initialize));
- // Note that DOM association is preserved in copies but only if they
- // are "complete", i.e., made from the root of the tree.
+ // The DOM association can be recreated in a copy (the underlying
+ // DOM document is cloned) if explicitly requested with the keep_dom
+ // flag and only if this copy is "complete", i.e., made from the root
+ // of the tree.
//
- text copy (*t);
+ text copy (*t, xml_schema::flags::keep_dom);
// Print text.
//
diff --git a/xsd/examples/cxx/tree/mixed/makefile b/xsd/examples/cxx/tree/mixed/makefile
index 6316ec0..7c001f0 100644
--- a/xsd/examples/cxx/tree/mixed/makefile
+++ b/xsd/examples/cxx/tree/mixed/makefile
@@ -1,6 +1,5 @@
# file : examples/cxx/tree/mixed/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
+# copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
@@ -29,17 +28,16 @@ $(call import,\
#
$(driver): $(obj) $(xerces_c.l)
-$(obj) $(dep): cpp_options := -I$(src_root)/libxsd
+$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd
$(obj) $(dep): $(xerces_c.l.cpp-options)
genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx)
gen := $(addprefix $(out_base)/,$(genf))
$(gen): xsd := $(out_root)/xsd/xsd
-$(gen): xsd_options :=
$(gen): $(out_root)/xsd/xsd
-$(call include-dep,$(dep))
+$(call include-dep,$(dep),$(obj),$(gen))
# Convenience alias for default target.
@@ -69,7 +67,7 @@ $(dist): $(dist-common)
$(dist-win): $(dist-common)
$(call install-data,$(src_base)/README,$(dist_prefix)/$(path)/README.txt)
- $(call message,,unix2dos $(dist_prefix)/$(path)/README.txt)
+ $(call message,,todos $(dist_prefix)/$(path)/README.txt)
# Clean.
#
diff --git a/xsd/examples/cxx/tree/mixed/text.xml b/xsd/examples/cxx/tree/mixed/text.xml
index 69abe8f..21e32af 100644
--- a/xsd/examples/cxx/tree/mixed/text.xml
+++ b/xsd/examples/cxx/tree/mixed/text.xml
@@ -2,8 +2,7 @@
<!--
-file : examples/cxx/tree/text/text.xml
-author : Boris Kolpackov <boris@codesynthesis.com>
+file : examples/cxx/tree/mixed/text.xml
copyright : not copyrighted - public domain
-->
diff --git a/xsd/examples/cxx/tree/mixed/text.xsd b/xsd/examples/cxx/tree/mixed/text.xsd
index 8aa8280..9777f8a 100644
--- a/xsd/examples/cxx/tree/mixed/text.xsd
+++ b/xsd/examples/cxx/tree/mixed/text.xsd
@@ -3,7 +3,6 @@
<!--
file : examples/cxx/tree/mixed/text.xsd
-author : Boris Kolpackov <boris@codesynthesis.com>
copyright : not copyrighted - public domain
-->