W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

a problem with derivation by restriction

From: Stoyka Stoyanova <stoyka@practicorp.com>
Date: Wed, 12 Feb 2003 17:35:08 +0200
Message-ID: <026201c2d2ac$52b3fb10$3700000a@stoyka>
To: <xmlschema-dev@w3.org>
I try to validate my XML against XSD Schema (MyScheme.xsd - see below) using the XmlValidatingReader in my C# project.
Here is the error messge I've received:
    "XMLValidatingReader class cannot allow changing of attributes restriction."

but XMLSPY 5 has validate the same file successfully.
I've found that if the attribute (MinValue or MaxValue) is changed from "optional" to "prohibited", the XMLValidatingReader does'n generate an error.

Is that scheme correct or no?
Could you suggest me any XML validating parser?

Thanks,
Stoyka
------
MyScheme.xsd
<xs:schema>
 <xs:complexType name="MyType">
  <xs:attribute name="Description" type="xs:string" use="required" />
  <xs:attribute name="Value" type="xs:string" use="required" />
  <xs:attribute name="MinValue" type="xs:decimal" use="optional" />
  <xs:attribute name="MaxValue" type="xs:decimal" use="optional" />
 </xs:complexType>
 <xs:element name="MyElement">
  <xs:complexType>
   <xs:complexContent>
    <xs:restriction base="MyType">
     <xs:attribute name="Description" type="xs:string" use="required" />
     <xs:attribute name="Value" type="xs:string" use="required" />
     <xs:attribute name="MinValue" use="required" />
     <xs:attribute name="MaxValue" use="prohibited" />
    </xs:restriction>
   </xs:complexContent>
  </xs:complexType>
 </xs:element>
</xs:schema>
Received on Wednesday, 12 February 2003 10:39:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT