xtoken 0.1.1

Iterator based no_std XML Tokenizer using memchr
Documentation
  • Coverage
  • 76.92%
    10 out of 13 items documented1 out of 4 items with examples
  • Size
  • Source code size: 11.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.39 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Xiphoseer/xtoken
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Xiphoseer

xtoken

Iterator based no_std XML Tokenizer using memchr.

Design Goals

  • Operates on byte slices
  • Minimal Validation
  • Support for inline DTD declaration
  • Partition whole input into non-empty spans

Example

use xtoken::{Token, Tokenizer};

let tokens = Tokenizer::new(b"<x>Hello World!</x>").collect::<Vec<_>>();
assert_eq!(&tokens, &[
    Token::Element(b"<x>"),
    Token::Span(b"Hello World!"),
    Token::ElementEnd(b"</x>"),
]);

let tokens = Tokenizer::new(b"<!DOCTYPE xml>").collect::<Vec<_>>();
assert_eq!(&tokens, &[
    Token::Decl(b"<!DOCTYPE xml>")
]);