[Home] [By Thread] [By Date] [Recent Entries]

  • From: Eddie Robertsson <eddie@a...>
  • To: Huy-Lan Phan <Huylanp@O...>
  • Date: Thu, 18 Oct 2001 09:49:23 +1000

> Now I have another dilema. I have defined two attributes and they're
> both required. Somehow, if one if them is defined, the validation will
> go through without giving any error. It only gives error when both
> of them are missing. This is not what I'm looking for since I want
> both of them to be required, so if one of them is missing, I want the
> validation to give an error. I don't know if it's XML Spy's validation
> that is wrong.
> Here is the element defined with two mandatory attributes:
>
> <xsd:element name="Attachment">
>         <xsd:complexType>
>                 <xsd:simpleContent>
>                         <xsd:restriction base="xsd:base64Binary">
>                                 <xsd:attribute name="dt:dt"
> type="xsd:string" use="required"  default="bin.base64"/>
>                                 <xsd:attribute name="FileName"
> type="xsd:string" use="required"/>
>                         </xsd:restriction>
>                 </xsd:simpleContent>
>         </xsd:complexType>
> </xsd:element>
>

Appart from the attribute name "dt:dt" your schema looks fine to me. Maybe
this is what causing XML Spy to validate your schema incorrectly because
it works fine for me with XML Spy 4.0 if I change the name of the "dt:dt"
attribute to "dt".

Cheers,
/Eddie


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member