Skip to main content

resolve_namespace

Function resolve_namespace 

Source
pub fn resolve_namespace(uri: &str) -> Option<(&'static str, &'static str)>
Expand description

Resolve an XML namespace URI to (package_name, relpath_within_data_root).

Returns None if the namespace is not part of the ODNI schema set (e.g. upstream W3C namespaces that aren’t redistributed by ODNI, or a typo).

relpath_within_data_root does NOT include the package name prefix — combine with the per-package crate’s data_root() joined with the package name (or package_root()) to produce a filesystem path:

if let Some((pkg, rel)) = ism_data::resolve_namespace("urn:schema:guide:schema:ismcat") {
    // rel = "Schema/ISMCAT/SchemaGuideSchema.xsd"
    // path = ism_ismcat::package_root().join(rel)
}