W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

RE: restriction validation

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Thu, 28 Mar 2002 13:54:16 -0800
Message-Id: <8904C60CACA7D51191BC00805FEAAF4358EBB3@crdc-exch-7.crdc.kp.org>
To: "'zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN'" <michael.marchegay@rd.francetelecom.com>, "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
> -----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
Received on Thursday, 28 March 2002 17:11:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT