aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-12-15 13:09:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-12-15 13:09:25 +0200
commit4c408a85759eb42b6b84b8cdab81453df31cd289 (patch)
tree468d7a871442a8dcf98e475bc837d5c15c3a632e /tests
parent9d8b6cd9492deff6747649e0c87f3b7df51b9965 (diff)
Register substituting anonymous types with polymorphic maps
Diffstat (limited to 'tests')
-rw-r--r--tests/cxx/tree/polymorphism/ostream/makefile2
-rw-r--r--tests/cxx/tree/polymorphism/ostream/output5
-rw-r--r--tests/cxx/tree/polymorphism/ostream/test.xml13
-rw-r--r--tests/cxx/tree/polymorphism/ostream/test.xsd18
4 files changed, 29 insertions, 9 deletions
diff --git a/tests/cxx/tree/polymorphism/ostream/makefile b/tests/cxx/tree/polymorphism/ostream/makefile
index c6dd0b0..777d716 100644
--- a/tests/cxx/tree/polymorphism/ostream/makefile
+++ b/tests/cxx/tree/polymorphism/ostream/makefile
@@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf))
$(gen): xsd := $(out_root)/xsd/xsd
$(gen): xsd_options := --generate-polymorphic --polymorphic-type-all \
---generate-ostream
+--root-element root --generate-ostream
$(gen): $(out_root)/xsd/xsd
$(call include-dep,$(dep))
diff --git a/tests/cxx/tree/polymorphism/ostream/output b/tests/cxx/tree/polymorphism/ostream/output
index bf0e814..e7fbd68 100644
--- a/tests/cxx/tree/polymorphism/ostream/output
+++ b/tests/cxx/tree/polymorphism/ostream/output
@@ -11,3 +11,8 @@ a: a
fund: 1
c: c1
c: c2
+base:
+a: a
+fund: 1
+d: d1
+d: d2
diff --git a/tests/cxx/tree/polymorphism/ostream/test.xml b/tests/cxx/tree/polymorphism/ostream/test.xml
index 157e15c..5409d2a 100644
--- a/tests/cxx/tree/polymorphism/ostream/test.xml
+++ b/tests/cxx/tree/polymorphism/ostream/test.xml
@@ -1,9 +1,10 @@
-<t:root xmlns:t="test"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="test test.xsd">
+<root xmlns="test"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="test test.xsd">
<base><a>a</a><fund>1</fund></base>
- <base xsi:type="t:derived1"><a>a</a><fund>1</fund><b>b</b></base>
- <base xsi:type="t:derived2"><a>a</a><fund>1</fund><c>c1</c><c>c2</c></base>
+ <base xsi:type="derived1"><a>a</a><fund>1</fund><b>b</b></base>
+ <base xsi:type="derived2"><a>a</a><fund>1</fund><c>c1</c><c>c2</c></base>
+ <derived3><a>a</a><fund>1</fund><d>d1</d><d>d2</d></derived3>
-</t:root>
+</root>
diff --git a/tests/cxx/tree/polymorphism/ostream/test.xsd b/tests/cxx/tree/polymorphism/ostream/test.xsd
index cc1f7a8..ddeaeae 100644
--- a/tests/cxx/tree/polymorphism/ostream/test.xsd
+++ b/tests/cxx/tree/polymorphism/ostream/test.xsd
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
-<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test"
+ targetNamespace="test" elementFormDefault="qualified">
<complexType name="base">
<sequence>
@@ -7,6 +8,7 @@
<element name="fund" type="int"/>
</sequence>
</complexType>
+ <element name="base" type="t:base"/>
<complexType name="derived1">
<complexContent>
@@ -28,9 +30,21 @@
</complexContent>
</complexType>
+ <element name="derived3" substitutionGroup="t:base">
+ <complexType>
+ <complexContent>
+ <extension base="t:base">
+ <sequence>
+ <element name="d" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
<complexType name="type">
<sequence>
- <element name="base" type="t:base" maxOccurs="unbounded"/>
+ <element ref="t:base" maxOccurs="unbounded"/>
</sequence>
</complexType>