Can someone help me add a limit to this schema file (for OwnerEnglishName)? I know how to do this with a simple type, while in a complex type I don't know how to do it. Can anyone help?
Many thanks.
Original XML:
<PACIDemoSignedDoc PaciSDocID="HouseOwnerSignedEndorsement"> <OwnerEnglishName OENID="Name"></OwnerEnglishName> </PACIDemoSignedDoc>
Scheme (without restrictions):
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="PACIDemoSignedDoc" type="PACIDemoSignedDocType" /> <xs:complexType name="PACIDemoSignedDocType"> <xs:sequence> <xs:element name="OwnerEnglishName" type="OwnerEnglishNameType" /> </xs:sequence> <xs:attribute name="PaciSDocID" type="xs:string" /> </xs:complexType> <xs:complexType name="OwnerEnglishNameType"> <xs:attribute name="OENID" type="xs:string" /> </xs:complexType> </xs:schema>
Restriction code:
<xs:restriction base="xs:string"> <xs:minLength value="5"/> <xs:maxLength value="100"/> </xs:restriction>
source share