use-xml
Practical XML utility primitives for lightweight declaration, element, attribute, escaping, and comment handling.
Warning: versions below
0.3.0are experimental and may change as the crate matures.
Example Usage
use ;
let input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root id=\"42\"><!-- note --></root>";
let root = extract_root_element.unwrap;
assert!;
assert_eq!;
assert_eq!;
assert_eq!;
Scope
- XML declaration detection and conservative extraction
- root element and attribute inspection helpers
- XML escaping, unescaping, and comment stripping
Non-Goals
- a full XML parser
- XPath support
- XSD validation
- deep namespace resolution
License
Licensed under either of the following, at your option:
- MIT License
- Apache License, Version 2.0