You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(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.
The text was updated successfully, but these errors were encountered:
carphi
changed the title
Bug encountered: slashes ("/") in tag attributes may cause issues in deserialization
Bug encountered: slashes ("/") in attribute strings may cause issues in deserialization
Oct 16, 2024
carphi
changed the title
Bug encountered: slashes ("/") in attribute strings may cause issues in deserialization
Bug encountered: slashes ("/") in attribute strings may cause issues with deserialization
Oct 16, 2024
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.
(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.
The text was updated successfully, but these errors were encountered: