Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xml validation error

From: George Cristian Bina <george@---------.--->
To: nandanprasad <pola_nandana@---.--->
Date: 4/12/2007 3:50:00 PM
Hi Nandan,

Point 5.2 from 
http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction to which the 
error message refers tells you that basically the derived simple type is 
not a valid simple type derivation from the simple type of the base 
content type, that is your simple type

<xs:simpleType>
   <xs:union>
     <xs:simpleType>
       <xs:restriction base="xs:unsignedShort">
         <xs:enumeration value="0"/>
         <xs:enumeration value="5"/>
         <xs:enumeration value="10"/>
         <xs:enumeration value="15"/>
         <xs:enumeration value="20"/>
         <xs:enumeration value="25"/>
         <xs:enumeration value="30"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType>
       <xs:restriction base="xs:unsignedShort">
         <xs:minInclusive value="31"/>
       </xs:restriction>
     </xs:simpleType>
   </xs:union>
</xs:simpleType>

is not a restriction of xs:unsignedShort.

If you look at
http://www.w3.org/TR/xmlschema-1/#cos-st-derived-ok

you see in 2.2.3 that if your derived type is a union as in your case 
then you can derive that only from anySimpleType.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


nandanprasad wrote:
> 
> hi, 
> 
> while creating the below part of the xsd, I'm getting errors: 
> 
> <xs:element name="HealthState"> 
> <xs:complexType> 
> <xs:simpleContent> 
> <xs:restriction base="cim:cimUnsignedShort"> 
> <xs:simpleType> 
> <xs:union> 
> <xs:simpleType> 
> <xs:restriction base="xs:unsignedShort"> 
> <xs:enumeration value="0"/> 
> <xs:enumeration value="5"/> 
> <xs:enumeration value="10"/> 
> <xs:enumeration value="15"/> 
> <xs:enumeration value="20"/> 
> <xs:enumeration value="25"/> 
> <xs:enumeration value="30"/> 
> </xs:restriction> 
> </xs:simpleType> 
> <xs:simpleType> 
> <xs:restriction base="xs:unsignedShort"> 
> <xs:minInclusive value="31"/> 
> </xs:restriction> 
> </xs:simpleType> 
> </xs:union> 
> </xs:simpleType> 
> </xs:restriction> 
> </xs:simpleContent> 
> </xs:complexType> 
> </xs:element> 
> 
> where, the definition for cim:cimUnsignedShort is as follows in another
> xsd.: 
> 
> <xs:complexType name="cimUnsignedShort"> 
> <xs:simpleContent> 
> <xs:extension base="xs:unsignedShort"> 
> <xs:anyAttribute namespace="##any" processContents="lax"/> 
> </xs:extension> 
> </xs:simpleContent> 
> </xs:complexType> 
> 
> Im getting the following error while validating: 
> 
> Type '{anonymous}' is not a valid restriction of type
> 'cim:cimUnsignedShort'. 
> Error location: xs:schema / xs:element / xs:complexType / xs:simpleContent /
> xs:restriction / @base 
> derivation-ok-restriction.5.2: The simple type definition '{anonymous}' is
> not a valid restriction of the base type definition's content type
> 'xs:unsignedShort'. 
> 
> Please help me understand the problem. 
> 
> thanks in advance. 
> 
> Nandan.

From lists@n... Thu Apr 12 10:51:21 2007
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent