aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-04-02 12:22:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-04-02 12:22:38 +0200
commit8336dd4c16d4885989a6d8f0c83a4b401f5cb63b (patch)
tree26ca613e7f3a3fe9fb75bf5bb3b65503661e0ebf /tests/cxx
parente4c22d3686da0e973e21eae0561c1169c0eeff36 (diff)
Add support for attributes with default and fixed values.
tests/cxx/hybrid/default: new test tests/cxx/hybrid/binary: update to test default and fixed values
Diffstat (limited to 'tests/cxx')
-rw-r--r--tests/cxx/hybrid/binary/cdr/output.xml2
-rw-r--r--tests/cxx/hybrid/binary/cdr/test.xml4
-rw-r--r--tests/cxx/hybrid/binary/cdr/test.xsd12
-rw-r--r--tests/cxx/hybrid/binary/custom/output.xml2
-rw-r--r--tests/cxx/hybrid/binary/custom/test.xml4
-rw-r--r--tests/cxx/hybrid/binary/custom/test.xsd12
-rw-r--r--tests/cxx/hybrid/binary/xdr/output.xml2
-rw-r--r--tests/cxx/hybrid/binary/xdr/test.xml4
-rw-r--r--tests/cxx/hybrid/binary/xdr/test.xsd12
-rw-r--r--tests/cxx/hybrid/default/driver.cxx56
-rw-r--r--tests/cxx/hybrid/default/makefile98
-rw-r--r--tests/cxx/hybrid/default/output1
-rw-r--r--tests/cxx/hybrid/default/test.xml16
-rw-r--r--tests/cxx/hybrid/default/test.xsd228
-rw-r--r--tests/cxx/hybrid/makefile2
15 files changed, 445 insertions, 10 deletions
diff --git a/tests/cxx/hybrid/binary/cdr/output.xml b/tests/cxx/hybrid/binary/cdr/output.xml
index a484661..f36f755 100644
--- a/tests/cxx/hybrid/binary/cdr/output.xml
+++ b/tests/cxx/hybrid/binary/cdr/output.xml
@@ -1,2 +1,2 @@
-<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex x="1"><a>aaa</a></complex><complex x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
+<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex df1="123" df2="456" dv1="aaa bbb ccc" dv2="mmm nnn" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1"><a>aaa</a></complex><complex df1="123" df2="123" dv1="aaa bbb ccc" dv2="aaa bbb ccc" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
</base64_binary><hex_binary>6865782052696E617279</hex_binary><date>2001-10-26+02:00</date><date_time>2001-10-26T21:32:52+02:00</date_time><duration>P1Y2M3DT5H20M30S</duration><day>---01+02:00</day><month>--11+02:00</month><month_day>--02-11+02:00</month_day><year>2001+02:00</year><year_month>2001-11+02:00</year_month><time>21:32:52+02:00</time></t:root> \ No newline at end of file
diff --git a/tests/cxx/hybrid/binary/cdr/test.xml b/tests/cxx/hybrid/binary/cdr/test.xml
index acd75d2..1218c37 100644
--- a/tests/cxx/hybrid/binary/cdr/test.xml
+++ b/tests/cxx/hybrid/binary/cdr/test.xml
@@ -6,10 +6,10 @@
<enumeration>left</enumeration>
- <complex x="1">
+ <complex x="1" df2="456" ff2="123" dv2="mmm nnn" fv2="aaa bbb ccc">
<a>aaa</a>
</complex>
- <complex x="1" y="2">
+ <complex x="1" y="2" ff2="123" fv2="aaa bbb ccc">
<a>aaa</a>
<b>bbb</b>
<c>c</c>
diff --git a/tests/cxx/hybrid/binary/cdr/test.xsd b/tests/cxx/hybrid/binary/cdr/test.xsd
index 7a92c7e..5a2ea34 100644
--- a/tests/cxx/hybrid/binary/cdr/test.xsd
+++ b/tests/cxx/hybrid/binary/cdr/test.xsd
@@ -35,6 +35,18 @@
<element name="c" type="string" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="y" type="int"/>
+
+ <!-- test default/fixed values -->
+
+ <attribute name="df1" type="int" default="123"/>
+ <attribute name="df2" type="int" default="123"/>
+ <attribute name="ff1" type="int" fixed="123"/>
+ <attribute name="ff2" type="int" fixed="123" use="required"/>
+
+ <attribute name="dv1" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="dv2" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="fv1" type="NMTOKENS" fixed="aaa bbb ccc"/>
+ <attribute name="fv2" type="NMTOKENS" fixed="aaa bbb ccc" use="required"/>
</extension>
</complexContent>
</complexType>
diff --git a/tests/cxx/hybrid/binary/custom/output.xml b/tests/cxx/hybrid/binary/custom/output.xml
index a484661..f36f755 100644
--- a/tests/cxx/hybrid/binary/custom/output.xml
+++ b/tests/cxx/hybrid/binary/custom/output.xml
@@ -1,2 +1,2 @@
-<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex x="1"><a>aaa</a></complex><complex x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
+<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex df1="123" df2="456" dv1="aaa bbb ccc" dv2="mmm nnn" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1"><a>aaa</a></complex><complex df1="123" df2="123" dv1="aaa bbb ccc" dv2="aaa bbb ccc" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
</base64_binary><hex_binary>6865782052696E617279</hex_binary><date>2001-10-26+02:00</date><date_time>2001-10-26T21:32:52+02:00</date_time><duration>P1Y2M3DT5H20M30S</duration><day>---01+02:00</day><month>--11+02:00</month><month_day>--02-11+02:00</month_day><year>2001+02:00</year><year_month>2001-11+02:00</year_month><time>21:32:52+02:00</time></t:root> \ No newline at end of file
diff --git a/tests/cxx/hybrid/binary/custom/test.xml b/tests/cxx/hybrid/binary/custom/test.xml
index acd75d2..1218c37 100644
--- a/tests/cxx/hybrid/binary/custom/test.xml
+++ b/tests/cxx/hybrid/binary/custom/test.xml
@@ -6,10 +6,10 @@
<enumeration>left</enumeration>
- <complex x="1">
+ <complex x="1" df2="456" ff2="123" dv2="mmm nnn" fv2="aaa bbb ccc">
<a>aaa</a>
</complex>
- <complex x="1" y="2">
+ <complex x="1" y="2" ff2="123" fv2="aaa bbb ccc">
<a>aaa</a>
<b>bbb</b>
<c>c</c>
diff --git a/tests/cxx/hybrid/binary/custom/test.xsd b/tests/cxx/hybrid/binary/custom/test.xsd
index 7a92c7e..5a2ea34 100644
--- a/tests/cxx/hybrid/binary/custom/test.xsd
+++ b/tests/cxx/hybrid/binary/custom/test.xsd
@@ -35,6 +35,18 @@
<element name="c" type="string" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="y" type="int"/>
+
+ <!-- test default/fixed values -->
+
+ <attribute name="df1" type="int" default="123"/>
+ <attribute name="df2" type="int" default="123"/>
+ <attribute name="ff1" type="int" fixed="123"/>
+ <attribute name="ff2" type="int" fixed="123" use="required"/>
+
+ <attribute name="dv1" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="dv2" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="fv1" type="NMTOKENS" fixed="aaa bbb ccc"/>
+ <attribute name="fv2" type="NMTOKENS" fixed="aaa bbb ccc" use="required"/>
</extension>
</complexContent>
</complexType>
diff --git a/tests/cxx/hybrid/binary/xdr/output.xml b/tests/cxx/hybrid/binary/xdr/output.xml
index a484661..f36f755 100644
--- a/tests/cxx/hybrid/binary/xdr/output.xml
+++ b/tests/cxx/hybrid/binary/xdr/output.xml
@@ -1,2 +1,2 @@
-<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex x="1"><a>aaa</a></complex><complex x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
+<t:root xmlns:t="test"><list>1 2 3</list><union>abc</union><enumeration>left</enumeration><complex df1="123" df2="456" dv1="aaa bbb ccc" dv2="mmm nnn" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1"><a>aaa</a></complex><complex df1="123" df2="123" dv1="aaa bbb ccc" dv2="aaa bbb ccc" ff1="123" ff2="123" fv1="aaa bbb ccc" fv2="aaa bbb ccc" x="1" y="2"><a>aaa</a><b>bbb</b><c>c</c><c>cc</c><c>ccc</c></complex><choice></choice><choice><a>123</a></choice><choice><b>ab</b><b>cd</b><b>ef</b></choice><choice><c>12.34</c><d>false</d></choice><byte>65</byte><unsigned_byte>66</unsigned_byte><short>-222</short><unsigned_short>57005</unsigned_short><int>-57005</int><unsigned_int>3735928559</unsigned_int><long>-2147483648</long><unsigned_long>2147483647</unsigned_long><integer>-2147483648</integer><non_positive_integer>-2147483648</non_positive_integer><non_negative_integer>2147483647</non_negative_integer><positive_integer>2147483647</positive_integer><negative_integer>-2147483648</negative_integer><boolean>true</boolean><float>1234.12</float><double>12345678.1234568</double><decimal>1234567812345678</decimal><string>string</string><normalized_string>normalized string</normalized_string><token>one two three</token><name>name</name><name_token>name-token</name_token><name_tokens>name tokens</name_tokens><ncname>ncname</ncname><language>en-us</language><qname>xsi:schemaLocation</qname><id>elements1</id><id>elements2</id><id_ref>elements1</id_ref><id_refs>elements1 elements2</id_refs><any_uri>http://www.codesynthesis.com</any_uri><base64_binary>YmFzZTY0IGJpbmFyeQ==
</base64_binary><hex_binary>6865782052696E617279</hex_binary><date>2001-10-26+02:00</date><date_time>2001-10-26T21:32:52+02:00</date_time><duration>P1Y2M3DT5H20M30S</duration><day>---01+02:00</day><month>--11+02:00</month><month_day>--02-11+02:00</month_day><year>2001+02:00</year><year_month>2001-11+02:00</year_month><time>21:32:52+02:00</time></t:root> \ No newline at end of file
diff --git a/tests/cxx/hybrid/binary/xdr/test.xml b/tests/cxx/hybrid/binary/xdr/test.xml
index acd75d2..1218c37 100644
--- a/tests/cxx/hybrid/binary/xdr/test.xml
+++ b/tests/cxx/hybrid/binary/xdr/test.xml
@@ -6,10 +6,10 @@
<enumeration>left</enumeration>
- <complex x="1">
+ <complex x="1" df2="456" ff2="123" dv2="mmm nnn" fv2="aaa bbb ccc">
<a>aaa</a>
</complex>
- <complex x="1" y="2">
+ <complex x="1" y="2" ff2="123" fv2="aaa bbb ccc">
<a>aaa</a>
<b>bbb</b>
<c>c</c>
diff --git a/tests/cxx/hybrid/binary/xdr/test.xsd b/tests/cxx/hybrid/binary/xdr/test.xsd
index 7a92c7e..5a2ea34 100644
--- a/tests/cxx/hybrid/binary/xdr/test.xsd
+++ b/tests/cxx/hybrid/binary/xdr/test.xsd
@@ -35,6 +35,18 @@
<element name="c" type="string" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="y" type="int"/>
+
+ <!-- test default/fixed values -->
+
+ <attribute name="df1" type="int" default="123"/>
+ <attribute name="df2" type="int" default="123"/>
+ <attribute name="ff1" type="int" fixed="123"/>
+ <attribute name="ff2" type="int" fixed="123" use="required"/>
+
+ <attribute name="dv1" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="dv2" type="NMTOKENS" default="aaa bbb ccc"/>
+ <attribute name="fv1" type="NMTOKENS" fixed="aaa bbb ccc"/>
+ <attribute name="fv2" type="NMTOKENS" fixed="aaa bbb ccc" use="required"/>
</extension>
</complexContent>
</complexType>
diff --git a/tests/cxx/hybrid/default/driver.cxx b/tests/cxx/hybrid/default/driver.cxx
new file mode 100644
index 0000000..1ab379f
--- /dev/null
+++ b/tests/cxx/hybrid/default/driver.cxx
@@ -0,0 +1,56 @@
+// file : tests/cxx/hybrid/default/driver.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+// Test default attribute values.
+//
+
+#include <iostream>
+
+#include "test.hxx"
+#include "test-pimpl.hxx"
+#include "test-simpl.hxx"
+
+using namespace std;
+using namespace test;
+
+int
+main (int argc, char* argv[])
+{
+ if (argc != 2)
+ {
+ cerr << "usage: " << argv[0] << " test.xml" << endl;
+ return 1;
+ }
+
+ // Parse.
+ //
+ root_paggr root_p;
+
+ xml_schema::document_pimpl doc_p (
+ root_p.root_parser (),
+ root_p.root_namespace (),
+ root_p.root_name ());
+
+ root_p.pre ();
+ doc_p.parse (argv[1]);
+ type* r = root_p.post ();
+
+ // Serialize.
+ //
+ root_saggr root_s;
+
+ xml_schema::document_simpl doc_s (
+ root_s.root_serializer (),
+ root_s.root_namespace (),
+ root_s.root_name ());
+
+ doc_s.add_prefix ("t", "test");
+
+ root_s.pre (*r);
+ doc_s.serialize (cout);
+ root_s.post ();
+
+ delete r;
+}
diff --git a/tests/cxx/hybrid/default/makefile b/tests/cxx/hybrid/default/makefile
new file mode 100644
index 0000000..a13db85
--- /dev/null
+++ b/tests/cxx/hybrid/default/makefile
@@ -0,0 +1,98 @@
+# file : tests/cxx/hybrid/default/makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
+
+xsd := test.xsd
+cxx := driver.cxx
+
+obj := $(addprefix $(out_base)/,\
+$(cxx:.cxx=.o) \
+$(xsd:.xsd=.o) \
+$(xsd:.xsd=-pskel.o) \
+$(xsd:.xsd=-pimpl.o) \
+$(xsd:.xsd=-sskel.o) \
+$(xsd:.xsd=-simpl.o))
+
+dep := $(obj:.o=.o.d)
+
+xsde.l := $(out_root)/libxsde/xsde/xsde.l
+xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
+
+driver := $(out_base)/driver
+test := $(out_base)/.test
+clean := $(out_base)/.clean
+
+
+# Build.
+#
+$(driver): $(obj) $(xsde.l)
+
+$(obj) $(dep): $(xsde.l.cpp-options)
+
+genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.cxx) \
+ $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.cxx) \
+ $(xsd:.xsd=-pimpl.hxx) $(xsd:.xsd=-pimpl.cxx) \
+ $(xsd:.xsd=-sskel.hxx) $(xsd:.xsd=-sskel.cxx) \
+ $(xsd:.xsd=-simpl.hxx) $(xsd:.xsd=-simpl.cxx)
+
+gen := $(addprefix $(out_base)/,$(genf))
+
+$(gen): $(out_root)/xsde/xsde
+$(gen): xsde := $(out_root)/xsde/xsde
+$(gen): xsde_options += --generate-parser --generate-serializer \
+--generate-aggregate
+
+$(call include-dep,$(dep))
+
+# Convenience alias for default target.
+#
+.PHONY: $(out_base)/
+$(out_base)/: $(driver)
+
+
+# Test.
+#
+.PHONY: $(test)
+
+$(test): driver := $(driver)
+$(test): $(driver) $(src_base)/test.xml $(src_base)/output
+ $(call message,test $$1,$$1 $(src_base)/test.xml | diff -ubB $(src_base)/output -,$(driver))
+
+# Clean.
+#
+.PHONY: $(clean)
+
+$(clean): $(driver).o.clean \
+ $(addsuffix .cxx.clean,$(obj)) \
+ $(addsuffix .cxx.clean,$(dep)) \
+ $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean))
+
+
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(gen): | $(out_base)/.gitignore
+$(driver): | $(out_base)/.gitignore
+
+$(out_base)/.gitignore: files := driver $(genf)
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
+
+
+# How to.
+#
+$(call include,$(bld_root)/cxx/o-e.make)
+$(call include,$(bld_root)/cxx/cxx-o.make)
+$(call include,$(bld_root)/cxx/cxx-d.make)
+$(call include,$(scf_root)/xsde/hybrid/xsd-cxx.make)
+
+
+# Dependencies.
+#
+$(call import,$(src_root)/xsde/makefile)
+$(call import,$(src_root)/libxsde/xsde/makefile)
diff --git a/tests/cxx/hybrid/default/output b/tests/cxx/hybrid/default/output
new file mode 100644
index 0000000..8d41894
--- /dev/null
+++ b/tests/cxx/hybrid/default/output
@@ -0,0 +1 @@
+<t:root xmlns:t="test" any="" bool1="true" bool2="true" bool3="false" bool4="false" byte="-99" decimal1="1.12345" decimal2="-0.456" double1="1.12345" double2="1123.45" double3="-0.00012345" double4="NaN" double5="-INF" fix1="123" fix2="123" fix3="abc" fix4="abc" fix5="aaa bbb ccc" fix6="aaa bbb ccc" float1="1.123" float2="1123" float3="-0.000123" float4="NaN" float5="-INF" id="this" idref="this" idrefs="this" int="-99999" integer="-99999" language="en-us" long="-99999" ncname="abcd" ninteger="-99999" nmtoken="ab:cd" nmtokens1="a:b efg aaa" nmtokens2="abc" nninteger="99999" npinteger="-99999" nstring=" a b " pinteger="99999" qname1="foo" qname2="t:bar" short="-999" string1="" string2=" a b " token="a b" ubyte="99" uint="99999" ulong="99999" uri="http://example.com" ushort="999"><union a="abc"></union><list a="123 345 678" b="ab cd ef" c="abc" d="abc def"></list><simple a="123" b="abc" c="123" d="abc" e="abc" f="abc 123"></simple><date a="2009-03-31" b="2009-03-31Z" c="2009-03-31Z" d="2009-03-31Z" e="2009-03-31+12:30" f="2009-03-31-12:30" g="2002009-03-31-12:30"></date><time a="12:03:45" b="12:03:45.123Z" c="12:03:05.123Z" d="12:03:45.123Z" e="12:03:45.123+12:30" f="12:03:45-12:30"></time><date-time a="2009-03-31T12:03:45" b="2009-03-31T12:03:45.123Z" c="2002009-03-31T12:03:05.123-12:30"></date-time><duration a="P100Y" b="P100M" c="P100D" d="PT12H" e="PT12M" f="PT12.123S" g="-P100Y10M20DT12H12M1.123S"></duration><day a="---02" b="---22Z" c="---22-12:30"></day><month a="--02" b="--12Z" c="--12+12:30"></month><year a="2009" b="-2002009Z" c="2009-12:30"></year><month-day a="--02-02" b="--12-22Z" c="--12-22+12:30"></month-day><year-month a="2009-02" b="-2002009-12Z" c="2009-12-12:30"></year-month></t:root> \ No newline at end of file
diff --git a/tests/cxx/hybrid/default/test.xml b/tests/cxx/hybrid/default/test.xml
new file mode 100644
index 0000000..11bd0a7
--- /dev/null
+++ b/tests/cxx/hybrid/default/test.xml
@@ -0,0 +1,16 @@
+<t:root xmlns:t="test" id="this" fix2="123" fix4="abc" fix6="aaa bbb ccc">
+
+ <union/>
+ <list/>
+ <simple/>
+ <date/>
+ <time/>
+ <date-time/>
+ <duration/>
+ <day/>
+ <month/>
+ <year/>
+ <month-day/>
+ <year-month/>
+
+</t:root>
diff --git a/tests/cxx/hybrid/default/test.xsd b/tests/cxx/hybrid/default/test.xsd
new file mode 100644
index 0000000..366b37e
--- /dev/null
+++ b/tests/cxx/hybrid/default/test.xsd
@@ -0,0 +1,228 @@
+<?xml version="1.0"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">
+
+ <!-- union -->
+
+ <simpleType name="union">
+ <union memberTypes="int string"/>
+ </simpleType>
+
+ <complexType name="union-test">
+ <attribute default="abc" name="a" type="t:union"/>
+ </complexType>
+
+ <!-- list -->
+
+ <simpleType name="fix-list">
+ <list itemType="int"/>
+ </simpleType>
+
+ <simpleType name="var-list">
+ <list itemType="string"/>
+ </simpleType>
+
+ <simpleType name="list-item">
+ <restriction base="string"/>
+ </simpleType>
+
+ <simpleType name="usr-list">
+ <list itemType="t:list-item"/>
+ </simpleType>
+
+ <simpleType name="union-list">
+ <list itemType="t:union"/>
+ </simpleType>
+
+ <complexType name="list-test">
+ <attribute default="123 345 678" name="a" type="t:fix-list"/>
+ <attribute default=" ab cd ef " name="b" type="t:var-list"/>
+ <attribute default="abc" name="c" type="t:usr-list"/>
+ <attribute default="abc def" name="d" type="t:union-list"/>
+ </complexType>
+
+ <!-- simple type -->
+
+ <simpleType name="int-base">
+ <restriction base="int"/>
+ </simpleType>
+
+ <simpleType name="str-base">
+ <restriction base="string"/>
+ </simpleType>
+
+ <simpleType name="int">
+ <restriction base="t:int-base"/>
+ </simpleType>
+
+ <simpleType name="str">
+ <restriction base="t:str-base"/>
+ </simpleType>
+
+ <simpleType name="union-derived">
+ <restriction base="t:union"/>
+ </simpleType>
+
+ <simpleType name="list-derived">
+ <restriction base="t:usr-list"/>
+ </simpleType>
+
+ <complexType name="simple-test">
+ <attribute default="123" name="a" type="t:int-base"/>
+ <attribute default="abc" name="b" type="t:str-base"/>
+ <attribute default="123" name="c" type="t:int"/>
+ <attribute default="abc" name="d" type="t:str"/>
+ <attribute default="abc" name="e" type="t:union-derived"/>
+ <attribute default="abc 123" name="f" type="t:list-derived"/>
+ </complexType>
+
+ <!-- date/time types -->
+
+ <complexType name="date-test">
+ <attribute default="2009-03-31" name="a" type="date"/>
+ <attribute default="2009-03-31Z" name="b" type="date"/>
+ <attribute default="2009-03-31+00:00" name="c" type="date"/>
+ <attribute default="2009-03-31-00:00" name="d" type="date"/>
+ <attribute default="2009-03-31+12:30" name="e" type="date"/>
+ <attribute default="2009-03-31-12:30" name="f" type="date"/>
+ <attribute default="2002009-03-31-12:30" name="g" type="date"/>
+ </complexType>
+
+ <complexType name="time-test">
+ <attribute default="12:03:45" name="a" type="time"/>
+ <attribute default="12:03:45.123Z" name="b" type="time"/>
+ <attribute default="12:03:05.123+00:00" name="c" type="time"/>
+ <attribute default="12:03:45.123-00:00" name="d" type="time"/>
+ <attribute default="12:03:45.123+12:30" name="e" type="time"/>
+ <attribute default="12:03:45-12:30" name="f" type="time"/>
+ </complexType>
+
+ <complexType name="date-time-test">
+ <attribute default="2009-03-31T12:03:45" name="a" type="dateTime"/>
+ <attribute default="2009-03-31T12:03:45.123Z" name="b" type="dateTime"/>
+ <attribute default="2002009-03-31T12:03:05.123-12:30" name="c" type="dateTime"/>
+ </complexType>
+
+ <complexType name="duration-test">
+ <attribute default="P100Y" name="a" type="duration"/>
+ <attribute default="P100M" name="b" type="duration"/>
+ <attribute default="P100D" name="c" type="duration"/>
+ <attribute default="PT12H" name="d" type="duration"/>
+ <attribute default="PT12M" name="e" type="duration"/>
+ <attribute default="PT12.123S" name="f" type="duration"/>
+ <attribute default="-P100Y10M20DT12H12M1.123S" name="g" type="duration"/>
+ </complexType>
+
+ <complexType name="day-test">
+ <attribute default="---02" name="a" type="gDay"/>
+ <attribute default="---22Z" name="b" type="gDay"/>
+ <attribute default="---22-12:30" name="c" type="gDay"/>
+ </complexType>
+
+ <complexType name="month-test">
+ <attribute default="--02" name="a" type="gMonth"/>
+ <attribute default="--12Z" name="b" type="gMonth"/>
+ <attribute default="--12+12:30" name="c" type="gMonth"/>
+ </complexType>
+
+ <complexType name="year-test">
+ <attribute default="2009" name="a" type="gYear"/>
+ <attribute default="-2002009Z" name="b" type="gYear"/>
+ <attribute default="2009-12:30" name="c" type="gYear"/>
+ </complexType>
+
+ <complexType name="month-day-test">
+ <attribute default="--02-02" name="a" type="gMonthDay"/>
+ <attribute default="--12-22Z" name="b" type="gMonthDay"/>
+ <attribute default="--12-22+12:30" name="c" type="gMonthDay"/>
+ </complexType>
+
+ <complexType name="year-month-test">
+ <attribute default="2009-02" name="a" type="gYearMonth"/>
+ <attribute default="-2002009-12Z" name="b" type="gYearMonth"/>
+ <attribute default="2009-12-12:30" name="c" type="gYearMonth"/>
+ </complexType>
+
+
+ <complexType name="type">
+ <sequence>
+ <element name="union" type="t:union-test"/>
+ <element name="list" type="t:list-test"/>
+ <element name="simple" type="t:simple-test"/>
+ <element name="date" type="t:date-test"/>
+ <element name="time" type="t:time-test"/>
+ <element name="date-time" type="t:date-time-test"/>
+ <element name="duration" type="t:duration-test"/>
+ <element name="day" type="t:day-test"/>
+ <element name="month" type="t:month-test"/>
+ <element name="year" type="t:year-test"/>
+ <element name="month-day" type="t:month-day-test"/>
+ <element name="year-month" type="t:year-month-test"/>
+ </sequence>
+ <attribute name="any" type="anySimpleType" default=""/>
+
+ <attribute name="bool1" type="boolean" default="true"/>
+ <attribute name="bool2" type="boolean" default="1"/>
+ <attribute name="bool3" type="boolean" default="false"/>
+ <attribute name="bool4" type="boolean" default="0"/>
+
+ <attribute name="byte" type="byte" default="-99"/>
+ <attribute name="ubyte" type="unsignedByte" default="99"/>
+ <attribute name="short" type="short" default="-999"/>
+ <attribute name="ushort" type="unsignedShort" default="999"/>
+ <attribute name="int" type="int" default="-99999"/>
+ <attribute name="uint" type="unsignedInt" default="99999"/>
+ <attribute name="long" type="long" default="-99999"/>
+ <attribute name="ulong" type="unsignedLong" default="99999"/>
+
+ <attribute name="integer" type="integer" default="-99999"/>
+ <attribute name="npinteger" type="nonPositiveInteger" default="-99999"/>
+ <attribute name="nninteger" type="nonNegativeInteger" default="99999"/>
+ <attribute name="pinteger" type="positiveInteger" default="99999"/>
+ <attribute name="ninteger" type="negativeInteger" default="-99999"/>
+
+ <attribute name="float1" type="float" default="1.123"/>
+ <attribute name="float2" type="float" default="1.123e3"/>
+ <attribute name="float3" type="float" default="-.123E-3"/>
+ <attribute name="float4" type="float" default="NaN"/>
+ <attribute name="float5" type="float" default="-INF"/>
+
+ <attribute name="double1" type="double" default="1.12345"/>
+ <attribute name="double2" type="double" default="1.12345e3"/>
+ <attribute name="double3" type="double" default="-.12345E-3"/>
+ <attribute name="double4" type="double" default="NaN"/>
+ <attribute name="double5" type="double" default="-INF"/>
+
+ <attribute name="decimal1" type="decimal" default="1.12345"/>
+ <attribute name="decimal2" type="decimal" default="-.456"/>
+
+ <attribute name="string1" type="string" default=""/>
+ <attribute name="string2" type="string" default=" a b "/>
+ <attribute name="nstring" type="normalizedString" default=" a b "/>
+ <attribute name="token" type="token" default=" a b "/>
+ <attribute name="nmtoken" type="NMTOKEN" default="ab:cd"/>
+ <attribute name="nmtokens1" type="NMTOKENS" default=" a:b efg aaa "/>
+ <attribute name="nmtokens2" type="NMTOKENS" default="abc"/>
+ <attribute name="ncname" type="NCName" default=" abcd "/>
+ <attribute name="language" type="language" default=" en-us "/>
+ <attribute name="id" type="ID"/>
+ <attribute name="idref" type="IDREF" default="this"/>
+ <attribute name="idrefs" type="IDREFS" default=" this "/>
+ <attribute name="uri" type="anyURI" default=" http://example.com "/>
+
+ <attribute name="qname1" type="QName" default="foo"/>
+ <attribute name="qname2" type="QName" default="t:bar"/>
+
+ <!-- fixed -->
+
+ <attribute name="fix1" type="int" fixed="123"/>
+ <attribute name="fix2" type="int" fixed="123" use="required"/>
+ <attribute name="fix3" type="string" fixed="abc"/>
+ <attribute name="fix4" type="string" fixed="abc" use="required"/>
+ <attribute name="fix5" type="NMTOKENS" fixed="aaa bbb ccc"/>
+ <attribute name="fix6" type="NMTOKENS" fixed="aaa bbb ccc" use="required"/>
+
+ </complexType>
+
+ <element name="root" type="t:type"/>
+
+</schema>
diff --git a/tests/cxx/hybrid/makefile b/tests/cxx/hybrid/makefile
index 24ed1f0..46fc06c 100644
--- a/tests/cxx/hybrid/makefile
+++ b/tests/cxx/hybrid/makefile
@@ -8,7 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make
tests := polymorphism sequences
ifeq ($(xsde_iostream),y)
-tests += built-in list recursive test-template union
+tests += built-in default list recursive test-template union
ifeq ($(xsde_cdr),y)
tests += binary/cdr