Re: XML-Schema Validator Problems

Hi Billy,

> Here's part of my schema in concern:
> <xs:element name="VALUE">
>   <xs:complexType>
>     <xs:attribute name="value-attr" type="attrType" use="required"/>
>   </xs:complexType>
> </xs:element>
>
> <xs:simpleType name="attrType">
>   <xs:union>
>     <xs:simpleType>
>       <xs:restriction base="xs:string">                 <xs:enumeration value="N/A"/>                   <xs:enumeration value=""/>
>       </xs:restriction>
>     </xs:simpleType>
>     <xs:simpleType>
>         <xs:restriction base="xs:double"/>
>     </xs:simpleType>
>    </xs:union>
> </xs:simpleType>
>
> The VALUE element is designed to have double values or "N/A" or emtpy string values.
>
> And the elements are declared as follows in my XML:
> 1. <VALUE abc=""/>
> 2. <VALUE attrType="N/A"/>
> 3. <VALUE attrType="abc"/>
> 4. <VALUE/>
>
> For case 1, 2 and 3, the validator says my XML is valid (but case 1 and 3 should not be valid, according to the schema). The validator only detects the error for case 4.
>
> I am looking for help to clarify if it's my schema's syntax problem or if it's the incorrect implementation of the XMLSpy4 validator. Please help and suggest. (BTW, is there any recommended XML-Schema validator other than XMLSpy4's???)

Your schema code looks good to me and I just copied your code into XML Spy4b3 and everything works fine. So, I guess this means that XML Spy4 is in error although it seems strange since the b3 is working fine.

Cheers,
/Eddie

Received on Tuesday, 25 September 2001 03:33:21 UTC