Documentation
XPath 1.0 Evaluation Engine
Query and traverse XML trees with complete compliance, type conversion, and sub-expression optimization.
Syntax & Axes
oxml implements the complete W3C XPath 1.0 specification, including all 13 navigational axes:
child::anddescendant::parent::andancestor::following-sibling::andpreceding-sibling::attribute::(or@attr)self::anddescendant-or-self::(or//)
Standard Functions
Built-in support for all core XPath 1.0 function libraries:
- Node-set functions:
count(),id(),local-name(),namespace-uri(),name() - String functions:
string(),concat(),starts-with(),contains(),substring-before(),substring-after(),substring(),string-length(),normalize-space(),translate() - Boolean functions:
boolean(),not(),true(),false(),lang() - Number functions:
number(),sum(),floor(),ceiling(),round()
Rust API
Evaluate queries easily from Rust code:
use ;
let xml = r#"<store><book price="20"/><book price="40"/></store>"#;
let doc = parse?;
// Select nodes
let books = doc.select?;
assert_eq!;
// Evaluate numerical expressions
let total: f64 = doc.eval_number?;
assert_eq!;