RE: restriction validation

> -----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 UTC