Tests for XSD 1.1 wildcard extensions A number of tests, both valid and invalid, demonstrating use of the new XSD 1.1 features for wildcards, for example the notNamespace and notQName attributes. Basic test of xs:anyAttribute with notNamespace attribute Allows any attribute except for two designated namespaces Valid, no attributes present. Valid, permitted attributes present. Invalid, disallowed attributes present. Invalid, disallowed attributes present. Basic test of xs:anyAttribute with notNamespace attribute Allows any attribute except for two designated namespaces Valid, no children present. Valid, permitted children present. Invalid, disallowed children present. Invalid, disallowed atchildrentributes present. Basic test of xs:anyAttribute with notNamespace = ##local Allows any attribute so long as it's in a namespace Valid, no attributes present. Valid, permitted attributes present. Invalid, disallowed attribute present. Basic test of xs:any with notNamespace = ##local Allows any child so long as it's in a namespace Valid, no children present. Valid, permitted child present. Invalid, disallowed child present. Basic test of xs:anyAttribute with notNamespace = ##targetNamespace in a no-namespace schema Allows any attribute so long as it's in a namespace Valid, no attributes present. Valid, permitted attributes present. Invalid, disallowed attribute present. Basic test of xs:any with notNamespace = ##targetNamespace in a no-namespace schema Allows any child so long as it's in a namespace Valid, no children present. Valid, permitted child present. Invalid, disallowed child present. Cannot mix namespace and notNamespace attributes within anyAttribute Invalid schema Cannot mix namespace and notNamespace attributes within xs:any Invalid schema Test of xs:anyAttribute with notNamespace = ##targetNamespace in a namespaced schema Allows any attribute so long as it's in a namespace other than target Valid, no attributes present. Valid, permitted attributes present. Invalid, disallowed attribute present. Invalid, disallowed attribute present. Test of xs:any with notNamespace = ##targetNamespace in a namespaced schema Allows any child so long as it's in a namespace other than target Valid, no children present. Valid, permitted children present. Invalid, disallowed children present. Invalid, disallowed children present. Test of xs:anyAttribute with notNamespace = ##targetNamespace in a chameleon schema Allows any attribute so long as it's in a namespace other than target Valid, no attributes present. Valid, permitted attributes present. Invalid, disallowed attribute present. Invalid, disallowed attribute present. Test of xs:any with notNamespace = ##targetNamespace in a namespaced schema Allows any child so long as it's in a namespace other than target Valid, no children present. Valid, permitted children present. Invalid, disallowed children present. Invalid, disallowed children present. Union of two wildcards using notNamespace The union allows anything Valid, all attributes are permitted. Union of two wildcards using notNamespace The union allows abel but not cain Valid, abel is permitted. Invalid, cain is banished. Union of two wildcards using namespace and notNamespace respectively The union allows adam, eve, and abel but not cain Valid, all three attributes permitted. Invalid, cain is banished. Union of two wildcards using namespace and notNamespace respectively The union allows adam, eve, and abel but not cain. Inversion of wild015.xsd. Valid, all three attributes permitted. Invalid, cain is banished. Valid restriction of wildcards Restricted type disallows more namespaces than the base type disallows Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Valid restriction of wildcards Restricted type disallows more namespaces than the base type disallows Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Valid restriction of wildcards Restricted type disallows more namespaces than the base type disallows Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid restriction of wildcards Restricted type allows more namespaces than base type Invalid restriction of wildcards Restricted type allows more namespaces than base type Invalid restriction of wildcards Restricted type allows more namespaces than base type Wildcard intersection Type allows anything allowed by all the attribute wildcards Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in no namespace. Wildcard intersection Type allows anything allowed by all the attribute wildcards Valid, attribute permitted. Valid, attribute in no namespace. Invalid, attribute in disallowed namespace. Wildcard intersection Type allows anything allowed by all the attribute wildcards Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Wildcard intersection Type allows anything allowed by all the attribute wildcards Valid, attribute permitted. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Invalid, attribute in disallowed namespace. Basic test of xs:anyAttribute with notQName attribute Allows any attribute except for xml:space or xml:id Valid, only permitted attributes present. Invalid, disallowed xml:space attribute present. Invalid, disallowed xml:id attribute present. Basic test of xs:any with notQName attribute Allows any child element except for xml:space or xml:id Valid, only permitted elements present. Invalid, disallowed xml:space element present. Invalid, disallowed xml:id element present. Test of xs:any with notQName attribute in an xs:sequence model group Allows any child element except for a Valid, only permitted elements present. Invalid, disallowed element present. Invalid, not element present to match the wildcard. Example from the spec: restricting away a child element that overlaps a wildcard No speaker element allowed on the subtype Valid, only permitted elements present. Valid, valid instance of the subtype. Invalid, disallowed element "speaker" is present. Name in notQName is a name that would not be allowed anyway Violates rule 4 of 3.10.6.1 Wildcard Properties Correct Name in notQName is a name that would not be allowed anyway Violates rule 4 of 3.10.6.1 Wildcard Properties Correct Name in notQName is a name that would not be allowed anyway Violates rule 4 of 3.10.6.1 Wildcard Properties Correct Name in notQName is a name that would not be allowed anyway Violates rule 4 of 3.10.6.1 Wildcard Properties Correct Name in notQName is a name that would not be allowed anyway Violates rule 4 of 3.10.6.1 Wildcard Properties Correct Undeclared prefix in QName invalid QName in notQName attribute Invalid QName in notQName invalid QName in notQName attribute Invalid QName in notQName invalid QName in notQName attribute Invalid QName in notQName invalid QName in notQName attribute Banning xsi attributes has no effect xsi:type is validated without reference to attribute uses or wildcards Valid, xsi:type is permitted despite the wildcard. Invalid, xsi:type has to conform to the standard rules regardless of processContents=skip. Explicit attribute in xsi namespace is not allowed Error: see 3.2.6.4 xsi: not allowed xsi attribute wildcards are allowed There's no rule to stop non-standard attributes in the xsi namespace being introduced by wildcard Valid, xsi:banana is permitted by the wildcard. Invalid, xsi:nil is governed by the built-in type definition, not the wildcard. Wildcard intersection with notQName disallows the union of the disallowed QNames Valid, attribute f is permitted by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Wildcard intersection with notQName disallows the union of the disallowed QNames Valid, attribute f is permitted by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Wildcard union with notQName disallows the intersection of the disallowed QNames Valid, attribute a is permitted by the wildcard. Valid, attribute d is permitted by the wildcard. Invalid, attribute c is excluded by the wildcard. Invalid, attribute xml:space is excluded by the wildcard. Wildcard union with notQName and notNamespace disallows the intersection of the disallowed QNames Valid, attribute a is permitted by the wildcard. Valid, attribute d is permitted by the wildcard. Invalid, attribute c is excluded by the wildcard. Invalid, attribute xml:lang is excluded by the wildcard. Element Wildcard union with notQName and notNamespace disallows the intersection of the disallowed QNames Valid, child is permitted by the wildcard. Invalid, child element is excluded by the wildcard. Complex type restriction using wildcard particles Base type disallows QNames that the restricted type does not disallow Complex type restriction using wildcard particles Restricted type disallows all QNames that the base type disallows Complex type restriction using wildcard particles Restricted type disallows all QNames that the base type disallows Complex type restriction using wildcard particles Restricted type does not disallow all QNames that the base type disallows Element Wildcard with notQName=##defined Basic test of ##defined Valid, child is permitted by the wildcard. Valid, child is permitted by the wildcard. Invalid, child element is excluded by the wildcard. Invalid, child element is excluded by the wildcard. Element Wildcard with notQName=##defined Basic test of ##defined with multiple namespaces Valid, child is permitted by the wildcard. Valid, child is permitted by the wildcard. Invalid, child element is excluded by the wildcard. Invalid, child element is excluded by the wildcard. Attribute Wildcard with notQName=##defined Basic test of ##defined Valid, attribute is permitted by the wildcard. Valid, attribute is permitted by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Attribute Wildcard with notQName=##defined Valid restriction of wildcard Valid, attributes are permitted by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Attribute Wildcard with notQName=##defined Valid restriction of wildcard Valid, attributes are permitted by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Invalid, attribute is excluded by the wildcard. Attribute Wildcard with notQName=##defined Invalid restriction of wildcard Attribute Wildcard intersection with notQName=##defined Both wildcards specify notQName="##defined" Valid, attributes are permitted by the wildcard. Invalid, attribute is specifically excluded by the wildcard. Invalid, attribute is excluded by the wildcard, it's a global attribute declaration. Attribute Wildcard intersection with notQName=##defined One wildcard specifies notQName="##defined" Valid, attributes are permitted by the wildcard. Invalid, attribute is specifically excluded by the wildcard. Invalid, zong attribute is not present in the intersection of the attribute groups. Attribute Wildcard union with notQName=##defined Both wildcards specify notQName="##defined" so union is expressible Valid, attributes are permitted by the wildcard. Valid, attribute is allowed in the union wildcard. Invalid, attribute is excluded by the wildcard, it's a global attribute declaration. Element fails "dynamic EDC" test - governing type not substitutable for context-determined type Schema is valid, instance is not Invalid in 1.1, second e element fails dynamic EDC test. Element fails "dynamic EDC" test - lax wildcard Schema is valid, instance is not Valid, g element is skipped. Invalid in 1.1, second e element fails dynamic EDC test. Invalid in 1.1, second e element fails dynamic EDC test because of xsi:type Invalid in 1.1, second f element fails dynamic EDC test because of xsi:type Element fails "dynamic EDC" test - lax wildcard Schema is valid, instance is not Valid, second e element is OK. Valid, second f element is OK. Invalid in 1.1, second e element fails dynamic EDC test. Invalid in 1.1, second e element fails dynamic EDC test because of xsi:type Element fails "dynamic EDC" test - lax wildcard Schema is valid, instance is not Valid, g element is OK. Valid, second e element is OK because of xsi:type Invalid in 1.1, second e element fails dynamic EDC test. Element fails "dynamic EDC" test - lax wildcard Schema is valid, instance is not Valid, g element is OK because of xsi:type. Invalid in 1.1, g element fails dynamic EDC test. Element fails "dynamic EDC" test - lax wildcard Substitutability involving a union Valid, e element is OK, belongs to a member of the union. Element fails "dynamic EDC" test - lax wildcard Substitutability involving a union Valid, e element is not OK, belongs not to a member of the union. Element fails "dynamic EDC" test - lax wildcard Context determined type comes from base type of restriction Valid, e element is not OK, clashes with element particle e defined in base type. Element fails "dynamic EDC" test - lax wildcard - xs:all content model Context determined type comes from base type of restriction Basic test of notQName=##definedSibling notQName=##definedSibling in a sequence content model Valid. Invalid, a element is not OK, clashes with a defined sibling. Invalid, a element is not OK, clashes with a defined sibling. Basic test of notQName=##definedSibling with substitution groups notQName=##definedSibling in a sequence content model Valid. Invalid, a element is not OK, clashes with a defined sibling. Invalid, a element is not OK, clashes with a defined sibling. Test of notQName=##definedSibling with substitution groups in xs:all content model notQName=##definedSibling in an xs:all content model Valid. Invalid, a element is not OK, clashes with a defined sibling. Invalid, a element is not OK, clashes with a defined sibling. Test of wildcards and substitution groups in xs:all content model Variant of wild072 without the ##definedSibling, for comparison Valid. Invalid, a element is not OK, clashes with a defined sibling. Invalid, a element is not OK, clashes with a defined sibling. Test of openContent wildcards and substitution groups in xs:sequence content model Open Content with ##definedSibling Valid. Invalid, a element is not OK, clashes with a defined sibling. Invalid, a element is not OK, clashes with a defined sibling. Consistency of governing type declarations between locally-declared elements and wildcards in a content model Violation of Element Locally Valid (Complex Type) Rule 5 Valid. Invalid, a element is not OK, clashes with type of a sibling. Consistency of governing type declarations between locally-declared elements and wildcards in a content model Violation of Element Locally Valid (Complex Type) Rule 5 Valid. Invalid, a element is not OK, clashes with type of a sibling. Consistency of governing type declarations between locally-declared elements and wildcards in a content model Violation of Element Locally Valid (Complex Type) Rule 5, not a problem with a skip wildcard Valid. Valid, element is OK because it's a skip wildcard. Consistency of governing type declarations between locally-declared elements and strict wildcards in a content model Violation of Element Declarations Consistent (type tables differ) Consistency of governing type declarations between locally-declared elements and lax wildcards in a content model Violation of Element Declarations Consistent Consistency of governing type declarations between locally-declared elements and lax wildcards in a content model No violation of Element Declarations Consistent with a skip wildcard Valid, element is OK because it's a skip wildcard. Consistency of governing type declarations between locally-declared elements and strict wildcards in a content model Violation of Element Declarations Consistent (type tables differ) Consistency of governing type declarations between locally-declared elements in a content model No violation of Element Declarations Consistent because the type tables are "the same" Valid, element is OK. Element Wildcard union with notQName="##defined" Tests the spec note: Note: When one of the wildcards has defined in {disallowed names} and the other does not, then defined is not included in the union. This may allow QNames that are not allowed by either wildcard. This is to ensure that all unions are expressible. If defined is intended to be included, then it is necessary to have it in both wildcards. Valid, attribute is permitted by the wildcard. Invalid, attribute is excluded by the wildcard.