Re: restriction validation

I suppose a complexType defined as a restriction of a simpleType is not allowed as well (supposing the simpleContent tag was omitted
here for succinctness), even if tools like TurboXml and XmlSpy (didn't try the latest versions) allow it.

"Biron,Paul V" wrote:

> > -----Original Message-----
> > From: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
> > [SMTP:michael.marchegay@rd.francetelecom.com]
> > Sent: Thursday, March 28, 2002 8:26 AM
> > To:   'xmlschema-dev@w3.org'
> > Subject:      restriction validation
> >
> > Hello,
> >
> > I'm a newbie at XML Schema, but I have to write a parser that can deal
> > with every valid schema.
> >
> > I tried to look at "XML Schema Part 1" to find find the information that
> > could help me to validate facet constraints for a restriction, but I
> > haven't found it.
> >
> That's because they are in part 2.
>
> > If I had a document with incompatible length constraint:
> >
> > EXAMPLE
> > <?xml version = "1.0" encoding = "UTF-8"?>
> > <xs:schema xmlns:xs = " <http://www.w3.org/2001/XMLSchema>">
> >    <xs:element name="elem">
> >       <xs:complexType>
> >          <restriction base="string">
> >             <xs:maxLength value="2"/>
> >             <xs:minLength value="5"/>
> >          </restriction>
> >       </xs:complexType>
> >    </xs:element>
> > </xs:schema>
> >
> > I haven't find a rule that invalid this schema.
> > I would therefore know if it is valid or not ?
> >
> See section 4.3.2.4 (Schema Component Constraint: minLength <= maxLength)
> [1].
>
> > And if I had a document with two times the same length facet, is it valid
> > or not ?
> >
> > Example:
> > ?xml version = "1.0" encoding = "UTF-8"?>
> > <xs:schema xmlns:xs = " <http://www.w3.org/2001/XMLSchema>">
> >    <xs:element name="elem">
> >       <xs:complexType>
> >          <restriction base="string">
> >             <xs:minLength value="2"/>
> >             <xs:minLength value="5"/>
> >          </restriction>
> >       </xs:complexType>
> >    </xs:element>
> > </xs:schema>
> >
> This is invalid.  See section 4.1.3 (Schema Representation Constraint:
> Single Facet Value) [2].
>
> pvb
>
> References
> [1] http://www.w3.org/TR/xmlschema-2/#rf-minLength
> [2] http://www.w3.org/TR/xmlschema-2/#defn-rep-constr

--
Jacques Deseyne
SWIFTAlliance WebStation Development Team
IT/Interfaces
S.W.I.F.T. SCRL
Tel: +32 2 655 45 87
http://becqw460.swift.com

This e-mail and any attachments thereto may contain information that is
confidential and/or proprietary and is intended for the sole use of
the recipient(s) named above. It is not intended to create or affect
any contractual arrangements between the parties. If you have received
this e-mail by mistake, please notify the sender and delete it immediately.
Thank you for your cooperation.

Received on Friday, 29 March 2002 05:09:30 UTC