Hi.
Using VB.Net System.Xml 1.0
SchemaCollection Object
I am getting an error when trying to add
‘Schema A’ to the SchemaCollection.
Here are my schema files..
Schema A
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.twiststandards.org/3.0/ElectronicBilling"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.twiststandards.org/3.0/ElectronicBilling"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:include schemaLocation="TestTwistMsg.xsd"/>
<xs:complexType name="ElectronicBillingMsg">
<xs:complexContent>
<xs:extension base="MessageHeader">
<xs:sequence>
<xs:element name="serviceAdjustment" type="ServiceAdjustment"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ServiceAdjustment">
<xs:sequence>
<xs:element name="volumeChange" type="xs:decimal" minOccurs="0">
</xs:element>
<xs:element name="originalVolume" type="xs:decimal" minOccurs="0">
</xs:element>
<xs:element name="newVolume" type="xs:decimal" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
Schema B
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:complexType name="MessageHeader">
<xs:annotation>
<xs:documentation xml:lang="en">A type defining the content model for a
generic message header that is refined by its derived
classes.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="messageType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="creationTimestamp" type="xs:dateTime">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NotificationMessageHeader">
<xs:annotation>
<xs:documentation xml:lang="en">A type that refines the generic message
header to match the requirements of a NotificationMessage.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:restriction base="MessageHeader">
<xs:sequence>
<xs:element name="messageType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="creationTimestamp" type="xs:dateTime">
</xs:element>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Schema A ‘Includes’ Schema B.
The error is..
Undefined complexType 'MessageHeader' is used as a base for complex type
restriction
I can validate this schema in Stylus that is using Xerces Validation Parcer.
What can I do to skip/fix this error?
Thank You.
--
Igor