You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As was previously noted in #30 and #31, namespaces are being handled differently in each implementation. However, only two libraries behave consistently so there is no preferred way to handle namespaces. Also, it doesn't seem to be a bug in libxml, just a different default behaviour of each library. I have created this mini test for comparison: https://gist.github.com/jnv/11763399bcfcead72a2c
The source document contains namespaces both for elements and attributes.
Rexml drops namespaces for elements, but keeps attributes:
Dropping all namespaces would be the easiest solution, however this may lead to name clashes, especially considering that attrattributes and elements are merged into the same hash.
Ox's behaviour seems most correct to me, though it copies names verbatim which may cause problems, for example <atom:rel atom:href="..."> and <atom:rel href="..."> results two different hash keys; same goes for Rexml.
As was previously noted in #30 and #31, namespaces are being handled differently in each implementation. However, only two libraries behave consistently so there is no preferred way to handle namespaces. Also, it doesn't seem to be a bug in libxml, just a different default behaviour of each library. I have created this mini test for comparison: https://gist.github.com/jnv/11763399bcfcead72a2c
The source document contains namespaces both for elements and attributes.
Rexml drops namespaces for elements, but keeps attributes:
Nokogiri and libxml behave the same, they drop namespaces both for elements and attributes:
Ox keeps all namespaces:
Dropping all namespaces would be the easiest solution, however this may lead to name clashes, especially considering that attrattributes and elements are merged into the same hash.
Ox's behaviour seems most correct to me, though it copies names verbatim which may cause problems, for example
<atom:rel atom:href="...">
and<atom:rel href="...">
results two different hash keys; same goes for Rexml.Any ideas how this should be handled?
cc @flexik
The text was updated successfully, but these errors were encountered: