Skip to main content

XmlParser

Struct XmlParser 

Source
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>

Source

pub fn new(reader: R) -> Self

Create a new XML parser

Source

pub fn reader(&self) -> &Reader<R>

Get a reference to the underlying reader

Source

pub fn reader_mut(&mut self) -> &mut Reader<R>

Get a mutable reference to the underlying reader

Source

pub fn entity_resolver(&self) -> &EntityResolver

Get the entity resolver

Source

pub fn entity_resolver_mut(&mut self) -> &mut EntityResolver

Get a mutable reference to the entity resolver

Source

pub fn processing_instructions(&self) -> &[ProcessingInstruction]

Get processing instructions

Source

pub fn location(&self) -> Location

Get current location (line and column)

Source

pub fn read_event(&mut self) -> Result<Event<'static>>

Read the next event

Source

pub fn update_namespaces(&mut self, start: &BytesStart<'_>)

Update namespace map from element attributes

Source

pub fn extract_name( &self, start: &BytesStart<'_>, ) -> Result<(String, Namespace)>

Extract element name and namespace from a BytesStart event

Source

pub fn extract_attributes( &self, start: &BytesStart<'_>, ) -> Result<Vec<(String, String)>>

Extract attributes from a BytesStart event

Source

pub fn extract_text(&self, text: &[u8]) -> Result<String>

Extract text content from Text event (with entity resolution)

Source

pub fn extract_cdata(&self, cdata: &[u8]) -> Result<String>

Extract CDATA content (no entity resolution)

Auto Trait Implementations§

§

impl<R> Freeze for XmlParser<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for XmlParser<R>
where R: RefUnwindSafe,

§

impl<R> Send for XmlParser<R>
where R: Send,

§

impl<R> Sync for XmlParser<R>
where R: Sync,

§

impl<R> Unpin for XmlParser<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for XmlParser<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for XmlParser<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.