Struct xml5ever::driver::XmlParser [] [src]

pub struct XmlParser<Sink> where
    Sink: TreeSink
{ pub tokenizer: XmlTokenizer<XmlTreeBuilder<Sink::Handle, Sink>>, }

An XML parser, ready to recieve Unicode input through the tendril::TendrilSink trait’s methods.

Fields

Tokenizer used by XmlParser.

Methods

impl<Sink: TreeSink> XmlParser<Sink>
[src]

Wrap this parser into a TendrilSink that accepts UTF-8 bytes.

Use this when your input is bytes that are known to be in the UTF-8 encoding. Decoding is lossy, like String::from_utf8_lossy.

Wrap this parser into a TendrilSink that accepts bytes and tries to detect the correct character encoding.

Currently this looks for a Byte Order Mark, then uses BytesOpts::transport_layer_encoding, then falls back to UTF-8.

FIXME(https://github.com/servo/html5ever/issues/18): this should look for <meta> elements

Trait Implementations

impl<Sink: TreeSink> TendrilSink<UTF8> for XmlParser<Sink>
[src]

What the overall result of processing is.

Process this tendril.

Indicates that an error has occurred.

Indicates the end of the stream.

Process one tendril and finish.

Consume an iterator of tendrils, processing each item, then finish.

Read from the given stream of bytes until exhaustion and process incrementally, then finish. Return Err at the first I/O error. Read more

Read from the file at the given path and process incrementally, then finish. Return Err at the first I/O error. Read more