Expand description
Streaming XML parsing. Streaming XML parser for handling large documents
This module provides memory-efficient streaming parsing for multi-gigabyte XML files. Instead of loading the entire document into memory, items are yielded incrementally.
§Features
- Memory-efficient: Process files larger than available RAM
- Incremental: Yields items as they’re parsed
- Configurable: Adjustable buffer sizes and recursion limits
- Type-safe: Returns
Resultfor error handling
§Examples
use std::fs::File;
use hedl_xml::streaming::{from_xml_stream, StreamConfig};
let file = File::open("large.xml")?;
let config = StreamConfig::default();
for result in from_xml_stream(file, &config)? {
match result {
Ok(item) => println!("Processed: {:?}", item),
Err(e) => eprintln!("Error: {}", e),
}
}Structs§
- Stream
Config - Configuration for streaming XML parsing
- Stream
Item - An item yielded by the streaming parser
- Stream
Position - Position information for progress tracking and error reporting
- XmlStreaming
Parser - A streaming XML parser that yields items incrementally
Enums§
- Entity
Policy - Policy for handling XML entities and DTDs
Functions§
- from_
xml_ stream - Create a streaming XML parser from a reader