Purpose
This guide provides comprehensive documentation for the XML mapping system in Lutaml::Model, with emphasis on the namespace-aware architecture that properly models W3C XML Namespace and XSD specifications.
What changed
The XML mapping system has been enhanced with a new namespace-aware architecture that correctly implements W3C XML Namespace semantics:
Architectural improvements:
-
XmlNamespaceclass for declarative namespace metadata -
Type-level namespace support for
Type::ValueandSerializableclasses -
element()as primary API for element declaration -
root()maintained as backward-compatible alias -
Type-only models use absence of element declaration instead of deprecated
no_root -
form:option for per-element qualification control -
documentation:option for XSD annotations
Why these changes:
-
W3C compliance: Properly separates Element (XML structure) from Type (data structure) as orthogonal concepts
-
Namespace semantics: URI is the identifier, prefixes are just labels
-
XSD generation: Full support for generating standards-compliant XSD schemas with proper namespace declarations
-
Reusability: Namespace definitions centralized and reusable across models
-
Maintainability: Clear separation of concerns between namespace metadata and usage