PureXML/Sources/Parsing
Mihaela Mihaljevic e4b2e0127d feat(parser): accept raw bytes with UTF-8/UTF-16 encoding detection
Add PureXML.parse(bytes:) and events(bytes:) for raw [UInt8] input. The encoding
is detected following the XML sniff order (BOM first, then the <? byte pattern,
defaulting to UTF-8) and decoded with the Swift standard library only, so the
package stays Foundation-free and portable. UTF-8 and UTF-16 (both byte orders,
with or without a BOM) are supported, the encoding set the XML spec requires.
Malformed input (odd-length UTF-16) raises ParseError.malformedEncoding.

PureXML.Parsing.InputEncoding.detect(_:) exposes the detector. The lint rule
optional_data_string_conversion is disabled because its suggested fix is a
Foundation API this package cannot use. Reimplemented from the documented XML
byte-detection algorithm; no upstream code copied.
2026-06-08 00:52:56 +02:00
..
ByteDecoder.swift feat(parser): accept raw bytes with UTF-8/UTF-16 encoding detection 2026-06-08 00:52:56 +02:00
EntityDecoder.swift feat(parser): add a streaming, iterative XML parser 2026-06-08 00:10:50 +02:00
Event.swift feat(parser): add a streaming, iterative XML parser 2026-06-08 00:10:50 +02:00
EventReader.swift feat(parser): add bounded-by-default limits (depth, name, content) 2026-06-08 00:40:34 +02:00
InputEncoding.swift feat(parser): accept raw bytes with UTF-8/UTF-16 encoding detection 2026-06-08 00:52:56 +02:00
Limits.swift feat(parser): add bounded-by-default limits (depth, name, content) 2026-06-08 00:40:34 +02:00
Mark.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
ParseError.swift feat(parser): accept raw bytes with UTF-8/UTF-16 encoding detection 2026-06-08 00:52:56 +02:00
Parser.swift feat(parser): accept raw bytes with UTF-8/UTF-16 encoding detection 2026-06-08 00:52:56 +02:00
Reader.swift feat(parser): add a streaming, iterative XML parser 2026-06-08 00:10:50 +02:00