KWARC / rust-libxml

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

Add get_property_no_ns to Node and RoNode #127

Closed anwaralameddin closed 8 months ago

anwaralameddin commented 8 months ago

The method get_property_no_ns was added to Node and RoNode in line with this issue.

The method get_property returns the value of the first property with a given local name, regardless of namespace. This can lead to undesirable results when an element has multiple properties with the same local name. For example, calling it with "bar" on the node below returns "NS BAR" instead of "BAR".

<foo xmlns:ns="http://example.com" ns:bar="NS BAR" bar="BAR" />

On the other hand, the method get_property_no_ns returns the value of the nonprefixed property.