ballsteve / xrust

XPath, XQuery, and XSLT for Rust
Apache License 2.0
89 stars 9 forks source link

Starting to remove intmuttree dependencies #82

Closed Devasta closed 4 months ago

Devasta commented 4 months ago

Hi Steve,

Started removing some of the uses of intmuttree on the parser tests.

Have also replaced a bunch of the parameters on the parse function with a single "parserconfig" struct, to allow us an easier time when we extend the parser later.

However, I am hitting some roadblocks around the Canonical XML feature, specifically for those tests that compare a file against its canonical representation... I can't seem to figure out how to get equality checks against two smite trees.

error[E0369]: binary operation `==` cannot be applied to type `Rc<xrust::trees::smite::Node>`
   --> tests\conformance\xml\xmltest_valid_sa.rs:293:46
    |
293 |     assert!(testxml.get_canonical().unwrap() == canonicalxml);
    |             -------------------------------- ^^ ------------ Rc<xrust::trees::smite::Node>
    |             |
    |             Rc<xrust::trees::smite::Node>

Mind taking a look? The other changes here should be fine to push in, if we can figure out the document comparison then I should be able to swap over the rest easily enough.

ballsteve commented 4 months ago

So for the tree comparison, you want to know if two trees represent the same XML Infoset? I'll see if I can use the PartialEq trait for that. Otherwise, I can define a comparison method on the Node trait.