Expand description
XML Writer API (§30, §85 Phase 7).
Streaming XML writer with indentation, encoding, escaping, document lifecycle.
Provides the xmlTextWriter* family of functions that allow constructing
XML documents in a streaming fashion — start/end element, write attributes,
text content, CDATA, comments, processing instructions, and DTD declarations.
§UPSTREAM-PARITY
This module mirrors libxml2’s xmlTextWriter API defined in xmlwriter.h.
The writer maintains a state machine that tracks whether we are inside an
element start tag (attributes can be written), inside an attribute value,
inside a CDATA section, etc.
Structs§
- XmlText
Writer - A streaming XML writer.
Functions§
- xmlFree
Text ⚠Writer - Free an XML text writer.
- xmlNew
Text ⚠Writer - Create a new XML text writer from an output buffer.
- xmlNew
Text ⚠Writer Doc - Create a new XML text writer for a document (tree mode).
- xmlNew
Text ⚠Writer Filename - Create a new XML text writer for a file.
- xmlNew
Text ⚠Writer Memory - Create a new XML text writer for a memory buffer.
- xmlNew
Text ⚠Writer Tree - Create a new XML text writer for a subtree.
- xmlText
Writer ⚠Close - Close the writer’s output buffer. The writer itself is NOT freed (upstream contract: xmlFreeTextWriter does that). Returns XML_ERR_OK (0) on success, XML_ERR_ARGUMENT (9) for a NULL writer or NULL output buffer.
- xmlText
Writer ⚠EndAttribute - End an attribute (closes the attribute value quote).
- xmlText
Writer ⚠EndCDATA - End a CDATA section.
- xmlText
Writer ⚠EndComment - End a comment.
- xmlText
Writer ⚠EndDTD - End a DTD declaration.
- xmlText
Writer ⚠EndDTD Attlist - End a DTD attribute-list declaration.
- xmlText
Writer ⚠EndDTD Attribute - End a DTD attribute declaration.
- xmlText
Writer ⚠EndDTD Element - End a DTD element declaration.
- xmlText
Writer ⚠EndDTD Entity - End a DTD entity declaration.
- xmlText
Writer ⚠EndDocument - End an XML document.
- xmlText
Writer ⚠EndElement - End an XML element.
- xmlText
Writer ⚠EndPI - End a processing instruction.
- xmlText
Writer ⚠Flush - Flush the writer’s output buffer.
- xmlText
Writer ⚠Full EndElement - Write a full end element (always writes
</name>, never self-closing). - xmlText
Writer ⚠SetIndent - Set indentation on/off.
- xmlText
Writer ⚠SetIndent String - Set the indentation string.
- xmlText
Writer ⚠SetQuote Char - Set the quote character used for attribute and entity values.
- xmlText
Writer ⚠Start Attribute - Write a formatted attribute.
- xmlText
Writer ⚠Start AttributeNS - Start a namespaced attribute (to be written incrementally).
- xmlText
Writer ⚠StartCDATA - Start a CDATA section.
- xmlText
Writer ⚠Start Comment - Start a comment.
- xmlText
Writer ⚠StartDTD - Start a DTD declaration.
- xmlText
Writer ⚠StartDTD Attlist - Start a DTD attribute-list declaration (
<!ATTLIST name). - xmlText
Writer ⚠StartDTD Attribute - Start a DTD attribute declaration.
- xmlText
Writer ⚠StartDTD Element - Start a DTD element declaration.
- xmlText
Writer ⚠StartDTD Entity - Start a DTD entity declaration.
- xmlText
Writer ⚠Start Document - Start an XML document.
- xmlText
Writer ⚠Start Element - Start an XML element.
- xmlText
Writer ⚠Start ElementNS - Start a namespaced XML element.
- xmlText
Writer ⚠StartPI - Start a processing instruction.
- xmlText
Writer ⚠Write Attribute - Write an attribute.
- xmlText
Writer ⚠Write AttributeNS - Write a namespaced attribute.
- xmlText
Writer ⚠Write Base64 - Write a formatted string.
- xmlText
Writer ⚠Write BinHex - Write BinHex-encoded data.
- xmlText
Writer ⚠WriteCDATA - Write a CDATA section.
- xmlText
Writer ⚠Write Comment - Write a comment.
- xmlText
Writer ⚠WriteDTD - Write a DTD declaration.
- xmlText
Writer ⚠WriteDTD Attlist - Write a DTD attribute-list declaration (StartDTDAttlist + WriteString + EndDTDAttlist).
- xmlText
Writer ⚠WriteDTD Attribute - Write a DTD attribute declaration.
- xmlText
Writer ⚠WriteDTD Element - Write a DTD element declaration.
- xmlText
Writer ⚠WriteDTD Entity - Write a DTD entity declaration.
- xmlText
Writer ⚠WriteDTD External Entity - Write a DTD external entity (StartDTDEntity + ExternalEntityContents + EndDTDEntity).
- xmlText
Writer ⚠WriteDTD External Entity Contents - Write the external-entity contents after
StartDTDEntity(PUBLIC/SYSTEM identifiers and NDATA). - xmlText
Writer ⚠WriteDTD Internal Entity - Write a DTD internal entity (StartDTDEntity + WriteString + EndDTDEntity).
- xmlText
Writer ⚠WriteDTD Notation - Write a DTD notation declaration.
- xmlText
Writer ⚠Write Element - Write an element with inline content.
- xmlText
Writer ⚠Write ElementNS - Write a namespaced element with inline content.
- xmlText
Writer ⚠WritePI - Write a processing instruction.
- xmlText
Writer ⚠Write Raw - Write raw content (no XML escaping).
- xmlText
Writer ⚠Write RawLen - Write raw content with explicit length (no XML escaping).
- xmlText
Writer ⚠Write String - Write text content.
- xmlText
Writer ⚠WriteV Format Attribute - xmlText
Writer ⚠WriteV Format AttributeNS - xmlText
Writer ⚠WriteV FormatCDATA - xmlText
Writer ⚠WriteV Format Comment - xmlText
Writer ⚠WriteV FormatDTD - xmlText
Writer ⚠WriteV FormatDTD Attlist - xmlText
Writer ⚠WriteV FormatDTD Element - xmlText
Writer ⚠WriteV FormatDTD Internal Entity - xmlText
Writer ⚠WriteV Format Element - xmlText
Writer ⚠WriteV Format ElementNS - xmlText
Writer ⚠WriteV FormatPI - xmlText
Writer ⚠WriteV Format Raw - xmlText
Writer ⚠WriteV Format String