KXML::Parser
Strict, pure-Crystal XML 1.0 (Fifth Edition) parser.
Implemented directly from W3C REC-xml-20081126 (well-formedness only,
no DTD validation). Raises KXML::Error on any well-formedness
violation, mirroring lxml's non-recovering behavior.
Constants
Element nesting is recursive (parse_element <-> parse_content), so the limit must stay low enough that the guard raises KXML::Error before the call stack overflows. Stack overflow testing shows nesting dies around depth ~6,000 on an 8 MB stack; 2,048 (libxml2's XML_MAX_DEPTH) leaves a wide safety margin across platforms.
Predefined entities (4.6). Stored as their spec-required replacement texts: char references to the respective character (double escaping REQUIRED for lt/amp so references re-expand to data, never markup).
Constructors
Class methods
2.11: #xD#xA and any lone #xD become #xA on input, before parsing. Single pass; the gsub pair this replaces allocated two intermediates.