1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # 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`).
pub use ;
pub use ;
/// 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";