Expand description
XML Reader API (§30, §85 Phase 7).
Cursor-based streaming reader with node type, depth, attribute traversal, namespace lookup, value retrieval, validation integration.
Implements the xmlTextReader API from libxml2, which provides a
cursor-based streaming interface for reading XML documents. The reader
parses the entire document into a tree on the first Read() call, then
walks the tree in document order (depth-first traversal) generating
node events for elements, text, comments, PIs, etc.
§UPSTREAM-PARITY
The reader API is defined in libxml/xmlreader.h and libxml/xmlreader.c.
Key differences from upstream:
- The reader parses the full document on first Read rather than using a true streaming/event-driven parser. This simplifies the implementation while preserving the observable API surface.
- Pattern-based reader operations (xmlTextReaderPreservePattern, etc.) are not yet implemented.
Functions§
- xmlFree
Text ⚠Reader - Free a text reader.
- xmlNew
Text ⚠Reader - Create a new text reader from an input buffer.
- xmlReader
ForFd ⚠ - Create a text reader from a file descriptor.
- xmlReader
ForFile ⚠ - Create a text reader for a file.
- xmlReader
ForIO ⚠ - Create a text reader from I/O callbacks.
- xmlReader
ForMemory ⚠ - Create a text reader from memory.
- xmlText
Reader ⚠Attribute Count - Get the attribute count of the current element.
- xmlText
Reader ⚠Base Uri - Get the base URI of the current node.
- xmlText
Reader ⚠Const Name - Get a constant pointer to the name (no copy).
- xmlText
Reader ⚠Const Value - Get a constant pointer to the value (no copy).
- xmlText
Reader ⚠Current Doc - Get the current document from the reader.
- xmlText
Reader ⚠Depth - Get the depth of the current node.
- xmlText
Reader ⚠GetAttribute - Get an attribute value by name.
- xmlText
Reader ⚠GetAttribute No - Get an attribute value by index.
- xmlText
Reader ⚠GetAttribute Ns - Get an attribute value by local name and namespace URI.
- xmlText
Reader ⚠GetParser Prop - Get a parser property.
- xmlText
Reader ⚠HasAttributes - Check if the current node has attributes.
- xmlText
Reader ⚠HasValue - Check if the current node has a value.
- xmlText
Reader ⚠IsEmpty Element - Check if the current element is an empty element (no children).
- xmlText
Reader ⚠Local Name - Get the local name of the current node.
- xmlText
Reader ⚠Lookup Namespace - Look up a namespace by prefix.
- xmlText
Reader ⚠Move ToAttribute - Move to an attribute by name.
- xmlText
Reader ⚠Move ToAttribute No - Move to an attribute by index.
- xmlText
Reader ⚠Move ToElement - Move the reader back to the parent element (from an attribute).
- xmlText
Reader ⚠Move ToFirst Attribute - Move to the first attribute of the current element.
- xmlText
Reader ⚠Move ToNext Attribute - Move to the next attribute.
- xmlText
Reader ⚠Name - Get the name of the current node.
- xmlText
Reader ⚠Namespace Uri - Get the namespace URI of the current node.
- xmlText
Reader ⚠Next - Skip to the next sibling of the current node.
- xmlText
Reader ⚠Next Sibling - Skip to the next sibling (same as xmlTextReaderNext).
- xmlText
Reader ⚠Node Type - Get the node type of the current node.
- xmlText
Reader ⚠Prefix - Get the prefix of the current node.
- xmlText
Reader ⚠Prev - Skip to the previous sibling of the current node.
- xmlText
Reader ⚠Read - Advance the reader to the next node in document order.
- xmlText
Reader ⚠Read State - Get the read state.
- xmlText
Reader ⚠SetParser Prop - Set a parser property.
- xmlText
Reader ⚠Setup - Setup/reinitialize a reader with new input.
- xmlText
Reader ⚠Value - Get the value of the current node.