Skip to main content

parse_with_options

Function parse_with_options 

Source
pub fn parse_with_options(
    input: &str,
    opts: &XPathParseOptions,
) -> Result<ParsedXPath, XPathError>
Expand description

Parse an XPath expression with structured options, returning XPathError on failure.

This is the primary entry point for the parser API. It selects the lexer mode based on opts.mode and returns XPathError (not ParseError), making it suitable for use alongside bind and eval phases that also return XPathError.

ยงExample

use xsd_schema::xpath::parser::parse_with_options;
use xsd_schema::xpath::{XPathParseOptions, XPathMode};

let opts = XPathParseOptions { mode: XPathMode::XPath10 };
let result = parse_with_options("/a/b", &opts).unwrap();
println!("Parsed {} nodes", result.node_count());