Open carphi opened 1 month ago
You are confused with how namespace attributes are managed. They are not valid attributes (I've added a check to pedantic mode to disable xml and xmlns both as name and prefix). Adding an attribute called xmlns
will not put SVG in the correct namespace, thus the svg
tag when parsing does not match the namespace expected ("" or null) as it now has a namespace in the string.
What you want to do is to use:
@XmlSerialName("svg", "http://www.w3.org/2000/svg", "")
class Svg() { /* content */ }
(First of all, thank you for your awesome library!!!) I have the following class property in a class
svg
which i want to serialize:@XmlSerialName("xmlns") val xmlns: String = "http://www.w3.org/2000/svg"
It serializes correctly to
<svg xmlns="http://www.w3.org/2000/svg">...</svg>
However, when I want to deserialize the string again, i get this error:
nl.adaptivity.xmlutil.XmlException: Local name "{http://www.w3.org/2000/svg}svg" for root tag does not match expected name "svg"
I guess this is because the deserialzer looks for all occurences of '/svg' as the closing tag, because 'svg' is also my opening tag. However, '/svg' also occures in my attribute string.