Confusion with length facet and minLength facet on different derivation steps

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
My understanding, correct or not, was that an element with a restricted type should pass validation for the base type ( with the whitespace facet an exception ).
If setting the length facet is equivalent to setting the minLength and the maxLength at the same time then how is the xml below valid in visual studio?
<xs:simpleType name="LengthRestriction <br/>
<xs:restriction base="xs:string <br/>
<xs:length value="10 </xs:length><br/>
</xs:restriction><br/>
</xs:simpleType><br/>
<br/>
<xs:simpleType name="MaxLengthRestrictingLengthRestriction <br/>
<xs:restriction base="LengthRestriction <br/>
<xs:maxLength value="11 </xs:maxLength><br/>
</xs:restriction><br/>
</xs:simpleType>
and if it is valid then why is the base type below invalid in visual studio ?
<xs:simpleType name="MaxLengthRestriction <br/>
<xs:restriction base="xs:string <br/>
<xs:maxLength value="10 </xs:maxLength><br/>
</xs:restriction><br/>
</xs:simpleType><br/>
<br/>
<xs:simpleType name="LengthRestrictingMaxLengthRestriction <br/>
<xs:restriction base="MaxLengthRestriction <br/>
<xs:length value="11 </xs:length><br/>
</xs:restriction><br/>
</xs:simpleType>

Thanks in advance,

Tony Hallett

View the full article
 
Back
Top