xmlutil icon indicating copy to clipboard operation
xmlutil copied to clipboard

Bug encountered: slashes ("/") in attribute strings may cause issues with deserialization

Open carphi opened this issue 1 year ago • 1 comments
trafficstars

(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.

carphi avatar Oct 16 '24 19:10 carphi