[xsd-users] xerces validation problem

Boris Kolpackov boris at codesynthesis.com
Thu Jul 11 08:05:17 EDT 2013


Hi Georg,

Klima Georg <G.Klima at durst-online.at> writes:

> ERROR: element 'Print' has type that does not derive from type of
> corresponding element in the base
> 
> 		<xs:sequence>
> 			<xs:element name="Print" type="durst:PrintPrimitive_at" minOccurs="1" maxOccurs="unbounded"/>
> 		</xs:sequence>
>
> 	<xs:restriction base="durst:SlotBase_at">
> 		<xs:sequence>
>			<xs:element name="Print" type="durst:SlotPrintPrimitive_at" minOccurs="1" maxOccurs="unbounded"/>
> 		</xs:sequence>
> 	</xs:restriction>
>
> 	<xs:complexType name="SlotPrintPrimitive_at" abstract="true">
> 		<xs:complexContent>
> 	 		<xs:extension base="durst:PrintPrimitive_at">

Your SlotUnrestricted_vt derives by restriction from PrinterComponent_at.
This means that any instance of SlotUnrestricted_vt should also be valid
per PrinterComponent_at. However, your SlotPrintPrimitive_at is an
extension of PrintPrimitive_at (it adds extra attributes). As a result,
it cannot be used in this restriction (it allows more than the base).


> libxml (xmllint) and qt (xmlpatternsvalidator) perfectly accept this
> construct. - Who is wrong?

While the error message is slightly misleading, Xerces-C++ is correct
and the other two validators are broken.

Boris



More information about the xsd-users mailing list