KiteXmlToken
A tiny, forgiving XML reader: enough for EPUB's container.xml and OPF, for (X)HTML content, and for SVG.
Comments, the XML/DOCTYPE prologue, CDATA delimiters and processing instructions are skipped, and malformed markup is salvaged rather than rejected, because real files are messy. Names lose their namespace prefix and are lowercased, so <epub:switch epub:type="x"> reads as tag switch with attribute type.
val root = KiteXml.parse(svgBytes.decodeToString())
val width = root.attrs["width"]Content copied to clipboard