2
I’m trying to restrict the Authentication Context XML Schema Definition of specification SAML 2.0. The XSD document is available at here.
The part I’m trying to narrow down is one related to this part of the original XSD:
<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>
Well, I don’t know how to narrow down the complex type RestrictedPassword. Below is my XSD, which tries to restrict the original XSD.
<?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>
When I try to validate this XSD in that tool, it returns me an error, that I do not know what nor how to fix. The error is as follows:
-- Not valid. Error - Line 12, 51: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 51; rcase-Recurse.2: There is not a complete functional mapping between the particles. Error - Line 12, 51: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 51; derivation-ok-restriction.5.4.2: Error for type 'RestrictedPasswordType'. The particle of the type is not a valid restriction of the particle of the base. –
Could you give more details about the mistake you mentioned.
– Lucas Lima
Hello Lucas. Follow the mentioned error. -- Not Valid. Error - Line 12, 51: org.xml.sax.Saxparseexception; lineNumber: 12; columnNumber: 51; rcase-Recurse.2: There is not a complete Functional Mapping between the particles. Error - Line 12, 51: org.xml.sax.Saxparseexception; lineNumber: 12; columnNumber: 51; Derivation-ok-Restriction.5.4.2: Error for type 'Restrictedpasswordtype'. The Particle of the type is not a Valid Restriction of the Particle of the base.
– marloncdomenech