Expand description
Metadata-only meta-crate for the ODNI public XML schema set.
Carries no data files. Use this crate to:
- Enumerate the ODNI packages shipped by this workspace (
PACKAGES). - Look up which package declares a given XML namespace
(
package_for_namespace,relpath_for_namespace). - Detect which packages are reachable via crates.io vs. git-only
(
is_published,resolve_namespace_published,PUBLISHED_PACKAGES).
For actual schema files + integrity verification, depend on the
per-package crates ism-{pkg} (e.g. ism-ismcat, ism-ic-edh).
Each per-package crate exposes data_root(), package_root(),
verify_integrity(), and a MANIFEST_DIGEST const.
Not every per-package crate is on crates.io. The workspace ships 59 of
them, but only the subset listed in tools/published.toml is published
(and exposed via PUBLISHED_PACKAGES). Consumers running in environments
that can only reach crates.io (e.g. mirrored builds) should call
resolve_namespace_published instead of resolve_namespace to fail
loudly when codegen targets a git-only package.
§Example
// In a consumer's build.rs
let (pkg, rel) = ism_data::resolve_namespace("urn:schema:guide:schema:ismcat")
.expect("ISMCAT namespace is part of the ODNI set");
assert_eq!(pkg, "ISMCAT");
assert_eq!(rel, "Schema/ISMCAT/SchemaGuideSchema.xsd");
// Combine with the per-package crate's data_root():
// let path = ism_ismcat::data_root().join(pkg).join(rel);Constants§
- PACKAGES
- Names of the ODNI packages shipped under
data/. - PUBLISHED_
PACKAGES - Names of ODNI packages currently published to crates.io as
ism-{lower}crates, sorted for binary search. Subset ofPACKAGES.
Functions§
- crate_
name_ for - Return the cargo crate name for a given ODNI package.
- is_
published - Returns
trueifpackageships a per-package crate on crates.io. - known_
namespaces - Iterate over every
(namespace, package, relpath)known to the workspace. - package_
for_ namespace - Return just the package name that declares
uri, orNone. - relpath_
for_ namespace - Return just the relpath (within the package’s data root) for
uri, orNone. - resolve_
namespace - Resolve an XML namespace URI to
(package_name, relpath_within_data_root). - resolve_
namespace_ published - Like
resolve_namespace, but returnsNonewhen the namespace’s package is not on crates.io. Use to constrain codegen to crates.io- reachable packages.