Incremental XML parsing for scenarios where the complete document is not available upfront (e.g., socket streams, chunked HTTP).
Drop-in replacement for Saxy.Partial.
Example
{:ok, partial} = RustyXML.Partial.new(MyHandler, initial_state)
{:cont, partial} = RustyXML.Partial.parse(partial, "<root>")
{:cont, partial} = RustyXML.Partial.parse(partial, "<item/>")
{:cont, partial} = RustyXML.Partial.parse(partial, "</root>")
{:ok, final_state} = RustyXML.Partial.terminate(partial)
Summary
Functions
Get the current handler state without terminating.
Create a new partial parser.
Feed a chunk of XML data to the parser.
Terminate parsing and get the final state.
Types
@type t() :: %RustyXML.Partial{ handler: module(), opts: keyword(), parser: RustyXML.Native.parser_ref(), started: boolean(), state: any() }
Functions
Get the current handler state without terminating.
Create a new partial parser.
Feed a chunk of XML data to the parser.
Returns:
{:cont, partial}— more data expected{:halt, state}— handler returned{:stop, state}{:error, reason}— parse error
Terminate parsing and get the final state.
Sends :end_document to the handler.