Add PureXML.Emitting.Writer, the libxml2 xmlTextWriter model: emit a document with writeStartElement/writeAttribute/writeString/writeEndElement and friends, never building a tree. Escaping is extracted into a shared Emitting.Escaping helper used by both the writer and the serializer, so compact writer output is byte-identical to serializing the equivalent tree. Pretty mode indents element children (forward-only, so prefer compact for mixed content). Closes #32. Reimplemented from the libxml2 model; no upstream code copied. 6 tests; 90 total. |
||
|---|---|---|
| .. | ||
| Escaping.swift | ||
| Options.swift | ||
| Serializer.swift | ||
| Writer.swift | ||