module

KXML

Constants

XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace"
XMLNS_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/"

Class methods

decode_char_at(s : String, pos : Int) : Tuple(Char, Int32)

Decodes the UTF-8 character at byte position pos in s and returns it with its byte length. String#char_at indexes by character, which is wrong for a byte-driven scanner. Reads go through unsafe_byte_at with an explicit length guard (cheaper than checked byte_at on the hot path), and malformed sequences raise KXML::Error instead of letting the raw codepoint escape as a foreign exception.

Source
escape_attribute(io : IO, s : String) : Nil
Source
escape_attribute(s : String) : String
Source
escape_text(io : IO, s : String) : Nil

Streaming variants write the escaped form straight into io, so serialization never materializes an intermediate escaped string.

Source
escape_text(s : String) : String
Source
parse(source : String) : Document

Parses source as an XML 1.0 document. Raises KXML::Error on any well-formedness violation.

Source

Nested types