RE: XML-Schema Validator Problems

Surely the example below should read

1. <VALUE value-attr="">

and not

1. <VALUE attrType="">

since attrType is the name of the type, not the name of the attribute.

> -----Original Message-----
> From: Eddie Robertsson [mailto:eddie@allette.com.au]
> Sent: Tuesday, September 25, 2001 9:40 AM
> To: Billy Chan
> Cc: xmlschema-dev@w3.org
> Subject: 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 05:18:27 UTC