Expand description
Structural validation rules for XSD elements
This module provides validation functions for XSD structural constraints
that cannot be expressed in the frame’s allows() method. These include:
- Mutually exclusive attributes: e.g.,
nameXORrefon elements - Dependent attributes: e.g.,
keyrefrequiresrefer - Prohibited combinations: e.g., top-level element cannot have
minOccurs - XSD version gates: e.g.,
xs:assertrequires XSD 1.1
§XSD Structural Constraints
Per W3C XSD 1.0 specification:
| Element | Constraint |
|---|---|
| element (top) | Must have name, must not have ref/minOccurs/maxOccurs |
| element (local) | Must have exactly one of name or ref |
| attribute (top) | Must have name, must not have ref/use |
| attribute (local) | Must have exactly one of name or ref |
| simpleType | name required at top level, prohibited in local context |
| complexType | name required at top level, prohibited in local context |
| restriction | Must have base XOR inline type |
| extension | Must have base attribute |
| key/unique | Must have name attribute |
| keyref | Must have name and refer attributes |
| list | Must have itemType XOR inline simpleType |
| union | Must have memberTypes XOR inline simpleTypes |
Structs§
- Validation
Context - Validation context for structural checks
Constants§
- XSD_
1_ 1_ ATTRIBUTES - XSD 1.1 attribute names that are not allowed in XSD 1.0 mode
- XSD_
1_ 1_ ELEMENTS - XSD 1.1 element names that are not allowed in XSD 1.0 mode
Functions§
- validate_
attribute_ group_ structure - Validate attribute group element structure
- validate_
attribute_ structure - Validate attribute declaration structural constraints
- validate_
complex_ type_ structure - Validate complex type definition structure
- validate_
element_ structure - Validate element declaration structural constraints
- validate_
extension_ structure - Validate extension element structure
- validate_
group_ structure - Validate model group (group) element structure
- validate_
import_ structure - Validate import directive structure
- validate_
include_ structure - Validate include directive structure
- validate_
key_ unique_ structure - Validate key/unique element structure
- validate_
keyref_ structure - Validate keyref element structure
- validate_
list_ structure - Validate list element structure
- validate_
notation_ structure - Validate notation declaration structure
- validate_
redefine_ structure - Validate redefine directive structure
- validate_
restriction_ structure - Validate restriction element structure
- validate_
schema_ structure - Validate xs:schema document structure
- validate_
simple_ type_ structure - Validate simple type definition structure
- validate_
union_ structure - Validate union element structure
- validate_
xsd_ version_ attribute - Validate that an attribute is allowed in the current XSD version
- validate_
xsd_ version_ element - Validate that an element is allowed in the current XSD version