EDN Admin
Well-known member
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
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