Skip to main content

Module structure

Module structure 

Source
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., name XOR ref on elements
  • Dependent attributes: e.g., keyref requires refer
  • Prohibited combinations: e.g., top-level element cannot have minOccurs
  • XSD version gates: e.g., xs:assert requires XSD 1.1

§XSD Structural Constraints

Per W3C XSD 1.0 specification:

ElementConstraint
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
simpleTypename required at top level, prohibited in local context
complexTypename required at top level, prohibited in local context
restrictionMust have base XOR inline type
extensionMust have base attribute
key/uniqueMust have name attribute
keyrefMust have name and refer attributes
listMust have itemType XOR inline simpleType
unionMust have memberTypes XOR inline simpleTypes

Structs§

ValidationContext
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