djspiewak/anti-xml

Prefix handling is wrong

hamnis opened this issue · 2 comments

When you have a namespace asigned to the root node default prefix like this.

<root xmlns="urn:foo:bar">
<child/>
</root>

This translates into the Anti-xml tree

Elem(Some(""), "root", Attributes(), Map(("" -> "urn:foo:bar"), Group(Elem(None, "child", Attributes(), Map(("" -> "urn:foo:bar"), Group.empty))

This is incorrect. The prefix in the child node should also be Some("")

This works in my branch, I even added a test case for the .convert spec in trygvis@4e1a260

This is definitely an annoying parse issue, which we should fix. I'm not yet sure about the other changes though. Will comment on issue #78.