Closed wbervoets closed 10 months ago
The reason for the additional namespace/prefix declaration is that the default namespace binding does not apply to attributes. Attributes without prefix always map to the null namespace. You probably want the language attribute to be unqualified (or in the xml prefix/namespace if that is appropriate).
I have just pushed a version that may help a bit with this case. When you use default namespace attributes (the for now snapshot release) should now let the attribute be unqualified (no-namespace attributes). Your classes are incomplete (and incorrect - in terms of capitalisation).
Hi, I probably made a mistake when creating a simpler example. The snapshot version now lets the attribute unqualified. thanks! Any idea when you're planning a new release?
I've gathered quite a number of bug fixes myself (trying to implement xmlschema parsing - and validating that the schema is valid - gets lots and lots of edge cases exposed). I will look at making a bug fix release with those (and the other ones) soon.
Should now be released.
Hi,
I'm having a hard time to understand why the following happens:
Input XML
Kotlin
So when I do XML().decodeFromString first and then call encodeToString again the written output will use the default namespace for the root element but Child will have an added xmlns:n1="http://www.my-namespace.com" + n1 prefixes on attributes and elements.
I would expect that xmlns:n1 is not used and not necessary.
I've tried some combinations with ignoreNamespaces(), adding empty prefix and /or namespaces:
For example adding @XmlSerialName("Child", "http://www.my-namespace.com", "") @XmlSerialName("CardRequest", "http://www.my-namespace.com", "")
but this does not change anything.
When using @XmlSerialName("Child", "", "") I get an exception Namespace http://www.my-namespace.com does not match expected ""