Estou tentando restringir o `Authentication Context XML Schema Definition` da especificação `SAML 2.0`. O documento XSD está disponível em **[aqui][1]**. A parte que eu estou tentando restringir é uma relacionada a esta parte do XSD original: <xs:complexType name="PasswordType"> <xs:sequence> <xs:element ref="Length" minOccurs="0"/> <xs:element ref="Alphabet" minOccurs="0"/> <xs:element ref="Generation" minOccurs="0"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/> </xs:complexType> <xs:element name="RestrictedPassword" type="RestrictedPasswordType"/> <xs:complexType name="RestrictedPasswordType"> <xs:complexContent> <xs:restriction base="PasswordType"> <xs:sequence> <xs:element name="Length" type="RestrictedLengthType" minOccurs="1"/> <xs:element ref="Generation" minOccurs="0"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/> </xs:restriction> </xs:complexContent> </xs:complexType> Bem, eu não sei como restringir o tipo complexo `RestrictedPassword`. Abaixo está o meu XSD, que tenta restringir o XSD original. <?xml version="1.0" encoding="UTF-8"?> <xs:schema version="2.0" targetNamespace="urn:m:SAML:2.0:ac:classes:K" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:m:SAML:2.0:ac:classes:K" finalDefault="extension" blockDefault="substitution"> <xs:redefine schemaLocation="http://docs.oasis-open.org/security/saml/v2.0/saml-schema-authn-context-types-2.0.xsd"> <xs:complexType name="RestrictedPasswordType"> <xs:complexContent> <xs:restriction base="RestrictedPasswordType"> <xs:sequence> <xs:element ref="Length" minOccurs="0"/> <xs:element ref="Generation"/> <xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ExternalVerification" type="xs:anyURI" use="optional"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:redefine> </xs:schema> Quando eu tento validar este XSD [nessa ferramenta][2], ela me retorna um erro, que eu não sei o que nem como arrumar. [1]: http://docs.oasis-open.org/security/saml/v2.0/saml-schema-authn-context-types-2.0.xsd [2]: http://www.utilities-online.info/xsdvalidation/#.UwJAzK69h31