pub struct XmlCodec { /* private fields */ }Expand description
The ifcXML codec.
Construct with XmlCodec::default for the lossless compatibility dialect,
XmlCodec::strict for an exact namespace/release profile,
XmlCodec::with_schema_and_profile for strict output with schema-correct
attribute names, or XmlCodec::xsd to read and write the buildingSMART
XSD configuration.
Implementations§
Source§impl XmlCodec
impl XmlCodec
Sourcepub const fn strict(profile: XmlProfile) -> Self
pub const fn strict(profile: XmlProfile) -> Self
A codec that enforces one exact ifcXML release namespace and schema token.
It writes and reads the native layout under that namespace. The
output is well-formed and its root is the XSD’s ifcXML element, but
it is not valid against the release XSD: see XmlProfile.
Sourcepub const fn profile(&self) -> Option<XmlProfile>
pub const fn profile(&self) -> Option<XmlProfile>
The strict release profile, or None for compatibility mode.
Sourcepub const fn reading(&self) -> SchemaReading
pub const fn reading(&self) -> SchemaReading
How content the schema does not declare is treated. Applies to the native layout with a schema; the XSD layout is always strict.
Sourcepub const fn with_reading(self, reading: SchemaReading) -> Self
pub const fn with_reading(self, reading: SchemaReading) -> Self
The same codec reading native documents with reading.
SchemaReading::Lenient restores the pre-0.4 schema-aware read.
Has no effect on an XmlLayout::Xsd codec, which has no lenient
mode.
Sourcepub fn with_schema(schema: Arc<Schema>) -> Self
pub fn with_schema(schema: Arc<Schema>) -> Self
A codec that emits schema-correct attribute names and reads strictly.
Reading types every value from its declaration and refuses names the
schema does not declare (SchemaReading::Strict); chain
Self::with_reading for the lenient read.
Sourcepub fn with_schema_and_profile(schema: Arc<Schema>, profile: XmlProfile) -> Self
pub fn with_schema_and_profile(schema: Arc<Schema>, profile: XmlProfile) -> Self
A strict release-profile codec with schema-backed attribute names.
Reads strictly, as Self::with_schema does. Like Self::strict,
it writes the native layout, not the XSD configuration.
Sourcepub fn xsd(schema: Arc<Schema>, profile: XmlProfile) -> Self
pub fn xsd(schema: Arc<Schema>, profile: XmlProfile) -> Self
A reader and writer of the buildingSMART XSD configuration of
profile’s release.
schema must be that release’s schema; a mismatch is refused when
reading or writing. A document reads into the same Model as its
STEP form. A model writes as a document that validates against the
release XSD and reads back to the same model, its entities numbered
in model order; what the configuration cannot carry exactly is
refused with crate::XmlError::Unrepresentable or another typed
error, never written differently. The model’s header must declare
the profile’s schema token.