- From: Billy Chan <billy@hkust.net>
- Date: Thu, 20 Sep 2001 22:24:54 -0400 (EDT)
- To: xmlschema-dev@w3.org
Hi, I've tried using XMLSpy4 to validate a XML with the Schema I wrote for the XML. I just couldn't get my expected result. I think my schema should be correctly implemented and I wonder if it is because of XMLSpy4's validator's incorrect examination of my codes. 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???) Thank you very much. regards, Billy -- _______________________________________________ Get your free email from http://hkust.net Powered by Instant Portal
Received on Friday, 21 September 2001 04:55:51 UTC