kobold-xml 0.1.0

A clean-room, Rust-native COBOL-data XML layer (real XML GENERATE). Independent of GnuCOBOL/libcob; not a GnuCOBOL parity claim.
Documentation
//! # kobold-xml
//!
//! A **clean-room, Rust-native COBOL-data XML layer**. It turns a decoded COBOL record (a tree of named
//! fields with values) into deterministic XML, and is **independent of GnuCOBOL/libcob** -- it links no
//! COBOL runtime and reproduces no runtime's exact bytes.
//!
//! > **Not a GnuCOBOL parity claim.** This is a forward-looking interchange layer: *what a safe Rust-native
//! > COBOL XML layer should do*, not *what GnuCOBOL 3.2 does*. Its evidence is the `EXT.XML.*` court
//! > namespace.
//!
//! ## v0.1 -- XML GENERATE
//!
//! ```
//! use kobold_xml::{CobolField, record_to_xml, generate, GenerateOptions};
//!
//! let rec = CobolField::group("ACCOUNT", vec![
//!     CobolField::alnum("NAME", &b"JANE     "[..]),
//!     CobolField::numeric("BALANCE", &b"104277"[..], 2, false), // 1042.77
//! ]);
//! let xml = generate(&record_to_xml(&rec), &GenerateOptions::default());
//! assert_eq!(xml, "<ACCOUNT><NAME>JANE</NAME><BALANCE>1042.77</BALANCE></ACCOUNT>");
//! ```
//!
//! - [`generate`] serializes an explicit [`XmlElement`] tree to deterministic XML (`EXT.XML.GENERATE.1`),
//!   with explicit text/attribute escaping (`EXT.XML.ESCAPE.1`).
//! - [`record_to_xml`] maps a [`CobolField`] record tree to that XML tree (`FILLER` omitted; v0.1 value
//!   policy documented on the [`cobol`] module).
//!
//! ## v0.2 (planned) -- XML PARSE
//!
//! A real event stream + generate->parse round-trip (`EXT.XML.PARSE.1` / `EXT.XML.ROUNDTRIP.1`).
#![forbid(unsafe_code)]

pub mod generate;
pub mod cobol;

pub use cobol::{record_to_xml, sanitize_name, CobolField, CobolValue};
pub use generate::{escape_attr, escape_text, generate, GenerateOptions, XmlElement, XmlNode};

/// The extension court namespace -- never `GNURUST.*`. So a reader can never mistake this crate's evidence
/// for a GnuCOBOL parity claim.
pub const COURT_NAMESPACE: &str = "EXT.XML";