Skip to main content

Module xsd_loader

Module xsd_loader 

Source
Expand description

XTypes 1.3 Annex A — XSD schema loader for <types> XML (C4.5).

Spec OMG XTypes 1.3 §7.3.2 + §7.3.3 + Annex A: an XML type document (Annex-A schema) MUST be ingestible at runtime by a URI-capable loader. This is a precondition for create_type_w_uri and create_type_w_document (DynamicType API, comes with C4.1).

§Scope C4.5 (this stage)

  • URI loader: file://, data: (RFC 2397), inline bytes via load_type_libraries_from_string.
  • Structural XSD-Annex-A validation: checks the element/ attribute names + required attributes per type construct. A full XSD 1.1 engine (XPath, Schematron) is not implemented.
  • Spec namespace check: http://www.omg.org/spec/DDS-XML as the targetNamespace. Strict mode rejects a missing namespace.
  • Reuse C7.D: returns Vec<TypeLibrary> (XML data model from xtypes_def); the TypeObject bridge is a future extension (C4.5-b after C4.1).

§Deliberately not in the crate

  • A full XSD-1.1 validator (XPath, key/keyref, assertions).
  • HTTP/HTTPS URI schemes — only file:// + data:.
  • XML catalog resolution.

Enums§

ValidationMode
Strict vs lax validation mode.

Constants§

DDS_XML_NAMESPACE
Spec namespace for DDS-XML (XTypes Annex A + DDS-XML 1.0 §7.1.5).
MAX_DATA_URI_BODY
Maximum data: body (DoS cap, 1 MiB).
MAX_FILE_BYTES
Maximum file:// file size (DoS cap, 16 MiB).

Functions§

load_type_libraries_from_string
Loads XML type libraries directly from an inline string.
load_type_libraries_from_uri
Loads XML type libraries from a URI.