From 8286ac511144e4f17d34eac9affb97e50646344a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:25:44 +0200 Subject: Imported Upstream version 4.0.0 --- xsd/examples/cxx/tree/mixed/README | 6 +++++- xsd/examples/cxx/tree/mixed/driver.cxx | 9 +++++---- xsd/examples/cxx/tree/mixed/makefile | 10 ++++------ xsd/examples/cxx/tree/mixed/text.xml | 3 +-- xsd/examples/cxx/tree/mixed/text.xsd | 1 - 5 files changed, 15 insertions(+), 14 deletions(-) (limited to 'xsd/examples/cxx/tree/mixed') 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 // copyright : not copyrighted - public domain #include // 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 -# 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 @@ 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 @@ -- cgit v1.2.3