Hash :
92b394fc
Author :
Date :
2006-05-09T19:59:54
Fixed bug #341150, reported by Michael Romer. In * xmlschemas.c: Fixed bug #341150, reported by Michael Romer. In xmlSchemaBuildContentModelForSubstGroup(), xmlAutomataNewOnceTrans2() was incorrectly used instead of xmlAutomataNewTransition2() to mimic a xs:choice for substitution-groups. * test/schemas/subst-group-1_1.xsd test/schemas/subst-group-1_0.xml result/schemas/subst-group-1_0_1 result/schemas/subst-group-1_0_1.err: Added regression test supplied by Michael Romer for bug #341150.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
<?xml version="1.0" encoding="UTF-8"?>
<!-- Test for bug #341150 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<!-- This is the head of our substitution group for events that have only
simple content. -->
<xs:element name="SimpleEvent" type="SimpleEventType"/>
<!-- All SimpleEvent elements have the required set of attributes -->
<xs:complexType name="SimpleEventType">
<xs:simpleContent>
<xs:extension base="xs:anySimpleType">
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Common members of the SimpleEvent substitution group -->
<xs:element name="TestEvent" substitutionGroup="SimpleEvent">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="SimpleEventType">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<!-- Root element -->
<xs:element name="TestRoot" type="TestRootType"/>
<!-- Core data type of an audit trail -->
<xs:complexType name="TestRootType">
<xs:sequence>
<xs:element name="Events">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="SimpleEvent"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>