roxmltree
roxmltree copied to clipboard
`has_attribute` does not work with local name, unlike `has_tag_name`, which does
has_tag_name works with a local name, but has_attribute does not, which is inconsistent and surprising:
let doc = roxmltree::Document::parse("<root xmlns:foo=\"http://example.com/foo\"><foo:bar foo:baz=\"qux\"/></root>").unwrap();
let node = doc.descendants().last().unwrap();
assert_eq!(node.has_tag_name("bar"), true);
assert_eq!(node.has_attribute("baz"), false);
// similarly:
assert_eq!(node.attribute("baz"), None);