Open MatthD opened 1 year ago
Hi @MatthD ,
I see you wrote:
I would like to based my lib on your's instead of the C implementation.
just a word of warning - the current rust-libxml
crate depends on having the C headers installed, and is a thin wrapper over them in Rust.
It is not a full Rust reimplementation of libxml2. I am tracking the c2rust
project's port of libxml2 to see if one day we could indeed be fully Rust-native, but that is some ways away still.
As to checking XML well-formedness, it is possible that we have not yet fleshed that out in the wrapper layer. There is a dedicated method in Parser called is_well_formed_html which seems to be doing a decent job at this for HTML, and we may want to extend/generalize Parser to also support XML well-formedness checks.
Similarly, the Parser parse_file
method will currently always return error-free, as long as it managed to obtain a Document
from the underlying libxml2 layer. So the error check in your snippet will only catch cases where no document could be constructed.
Hello, I am the creator or
node-libxml
, I would like to based my lib on your's instead of the C implementation. I am facing difficulty to try to perform wellformed checkmain.rs
tests/data/test-not-wellformed.xml