RE: Substitution group and abstract element

Hi all,

Thanks a lot for your great help. It now works perfecty fine.

I include a schema and instance document for future reference.


Best regards,

Régis




schema :

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="BaseType" abstract="true"/>
	<xs:complexType name="DerivedTypeB">
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					<xs:element name="content"
type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="DerivedTypeC">
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					<xs:element name="content"
type="xs:base64Binary"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="root">
		<xs:complexType>
			<xs:sequence maxOccurs="unbounded">
				<xs:element name="test" type="BaseType"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>


instance document :

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="abstractTypeDerivation.xsd">
	<test xsi:type="DerivedTypeB">
		<content>1234</content>
	</test>
	<test xsi:type="DerivedTypeC">
		<content>asdf</content>
	</test>
</root>

Received on Tuesday, 12 February 2002 05:14:53 UTC