sshaw / ddex

DDEX metadata serialization for Ruby
https://metadatagui.com
52 stars 41 forks source link

Remove extra 'ns1' namespace from the beginning of every XML element name (ERN 3.8 and 3.8.1) #10

Closed benalavi closed 8 years ago

benalavi commented 8 years ago

Was working on generating DDEX XML today and realized that the generated code for 3.8 and 3.8.1 had a ns1 namespace prepended to the element tag names, i.e.:

https://github.com/sshaw/ddex/blob/v0.0.3/lib/ddex/ern/v381/new_release_message.rb#L29

This results in XML with double namespaces when you use DDEX.write which then fails to parse if you try to read it externally (at least in WebKit). This fix removes the extra ns1 namespace from all the generated classes.

I'm not sure what actually caused the problem: whether it is in the jaxb2xml library, or a dependency, or maybe just need to pass additional arguments when generating the code? I thought I'd add the fix before digging though in case you had an idea what caused the issue.

sshaw commented 8 years ago

May be a jabx2ruby issue. What version of Java and JRuby did you run it under?

sshaw commented 8 years ago

Also, would you care to write a test that or two that checks DDEX.write's output :neckbeard:?