pub struct XmlParser<R: BufRead> { /* private fields */ }Expand description
Wrapper around quick-xml Reader for parsing XSL-FO documents
Implementations§
Source§impl<R: BufRead> XmlParser<R>
impl<R: BufRead> XmlParser<R>
Sourcepub fn reader_mut(&mut self) -> &mut Reader<R>
pub fn reader_mut(&mut self) -> &mut Reader<R>
Get a mutable reference to the underlying reader
Sourcepub fn entity_resolver(&self) -> &EntityResolver
pub fn entity_resolver(&self) -> &EntityResolver
Get the entity resolver
Sourcepub fn entity_resolver_mut(&mut self) -> &mut EntityResolver
pub fn entity_resolver_mut(&mut self) -> &mut EntityResolver
Get a mutable reference to the entity resolver
Sourcepub fn processing_instructions(&self) -> &[ProcessingInstruction]
pub fn processing_instructions(&self) -> &[ProcessingInstruction]
Get processing instructions
Sourcepub fn read_event(&mut self) -> Result<Event<'static>>
pub fn read_event(&mut self) -> Result<Event<'static>>
Read the next event
Sourcepub fn push_namespace_scope(&mut self, start: &BytesStart<'_>)
pub fn push_namespace_scope(&mut self, start: &BytesStart<'_>)
Push a new namespace scope parsed from the element’s xmlns/xmlns:* attributes.
Call this when entering a Start or Empty element.
Sourcepub fn pop_namespace_scope(&mut self)
pub fn pop_namespace_scope(&mut self)
Pop the innermost namespace scope. No-op if the stack is empty.
Sourcepub fn resolve_prefix<'a>(&'a self, prefix: &str) -> Option<&'a str>
pub fn resolve_prefix<'a>(&'a self, prefix: &str) -> Option<&'a str>
Resolve a namespace prefix to a URI, searching from innermost scope outward.
Returns None if the prefix is not in scope.
Sourcepub fn snapshot_in_scope(&self) -> Vec<(String, String)>
pub fn snapshot_in_scope(&self) -> Vec<(String, String)>
Return all namespaces currently in scope as (prefix, uri) pairs,
with innermost bindings winning over outer ones. Sorted by prefix
for determinism. Empty string prefix = default namespace.
Sourcepub fn extract_name(
&self,
start: &BytesStart<'_>,
) -> Result<(String, Namespace)>
pub fn extract_name( &self, start: &BytesStart<'_>, ) -> Result<(String, Namespace)>
Extract element name and namespace from a BytesStart event
Sourcepub fn extract_attributes(
&self,
start: &BytesStart<'_>,
) -> Result<Vec<(String, String)>>
pub fn extract_attributes( &self, start: &BytesStart<'_>, ) -> Result<Vec<(String, String)>>
Extract attributes from a BytesStart event
Sourcepub fn extract_text(&self, text: &[u8]) -> Result<String>
pub fn extract_text(&self, text: &[u8]) -> Result<String>
Extract text content from Text event (with entity resolution)
Sourcepub fn extract_cdata(&self, cdata: &[u8]) -> Result<String>
pub fn extract_cdata(&self, cdata: &[u8]) -> Result<String>
Extract CDATA content (no entity resolution)