KWARC / rust-libxml

Rust wrapper for libxml2
https://crates.io/crates/libxml
MIT License
76 stars 38 forks source link

Wrapper for xmlXPathCompile binding #93

Closed bcpeinhardt closed 2 years ago

bcpeinhardt commented 2 years ago

Haven't written any proper tests to see what the function covers, but getting back an error msg of "invalid xpath syntax" is promising!

bcpeinhardt commented 2 years ago

^^ Regarding my earlier commit message stack overflow tells me free on a null pointer is a no-op not a double free but it sure feels wrong haha.

dginev commented 2 years ago

Thanks for contributing this @bcpeinhardt ! I was extra-slow in getting to replying to this PR, apologies.

One bit we can address here is the name of the new method. For example, we have a parser method called is_well_formed_html, which is closer to what I would expect of a condition-checking function returning a boolean.

Maybe is_well_formed_xpath would be a name that is easier to read in vacuum?