You need to create a simple type like so:
<xs:simpleType name="LimitedString">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
and then use this new type in your schema:
<xs:complexType name="test">
<xs:sequence>
<xs:element name="abc" type="xs:String" />
</xs:sequence>
<xs:attribute type="LimitedString" name="myattr" />
</xs:complexType>
Marc
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…