Set namespaces of attributes correctly

Also added tests for them.

I'm not sure what happens to prefixed elements, but that's all the info I could find in the parser output format for now.
Nits: line at end of file; double quotes; use hyphens for file names. (all of this also applies to ns_svg)