Expand description
XML utility functions for character classification and string helpers.
Provides the low-level character classification routines needed by the parser, matching the XML 1.0 specification’s definitions for name characters, whitespace, and UTF-8 handling.
§Compatibility with TinyXML2
These functions match TinyXML2’s XMLUtil static methods. TinyXML2 uses a
simplified character classification that covers ASCII and common Unicode
ranges. Our implementation follows the same practical subset.
Functions§
- collapse_
whitespace - Collapses whitespace in a string according to TinyXML2’s
COLLAPSE_WHITESPACEmode. - is_
name_ char - Returns
trueif the character can appear in an XML name (after the first character). - is_
name_ start_ char - Returns
trueif the character can start an XML name. - is_
whitespace - Returns
trueif the character is XML whitespace. - is_
whitespace_ byte - Returns
trueif the byte is XML whitespace. - read_
name - Reads an XML name from the beginning of a string slice.
- skip_
whitespace - Skips whitespace characters at the beginning of a string slice.
- starts_
with_ bom - Checks if a string starts with the UTF-8 BOM (byte order mark).
- strip_
bom - Strips the UTF-8 BOM from the beginning of a string if present.