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
Exception in thread "main" nl.adaptivity.xmlutil.serialization.XmlParsingException: Invalid XML value at position: null: local name "Test_123" does not match expected "TestElement" (4:14)
this broke with the update t0 0.9.2 (and i have been dragging my feet to update)
how do we apprach this now?
example snippets (no control over the input XML sadly)
and we want to parse this into a structure like this (although if implementation forces a slightly different structure on us we can live with it)
@Serializable(with =LibraryClosedSectionsSerializer::class)
data classLibraryClosedSections(
valsections:List<LibraryClosedSection>
) {
@Serializable
data classLibraryClosedSection(
valindex:Int,
@XmlSerialName("Value")
valvalue:String
)
}
@Serializable(with =QueueWindowsSerializer::class)
data classQueueWindows(
valqueues:List<Queue>
) {
@Serializable
data classQueue(
valindex:Int,
@SerialName("Name")
valname:String,
// additional attributes omitted for brevity.. its just more of the same
@XmlElement
@SerialName("Presets")
valpresetsContainer:Presets,
) {
val presets get() = presetsContainer.presets
@Serializable
data classPresets(
@XmlElement
@SerialName("Presets")
valpresets:List<Preset>,
) {
@Serializable
@XmlSerialName("Preset")
data classPreset(
@SerialName("Name")
valname:String,
@SerialName("Id")
valid:Int,
@SerialName("Type")
valtype:String? = null,
@SerialName("Comments")
valcomments:String? = null,
// additional attributes omitted for brevity.. its just more of the same
)
}
}
}
this now breaks with
Invalid XML value at position: null: local name "Section_3" does not match expected "LibraryClosedSection" (1:925)
how do we approach this kind of (awful) XML?
.. and i hope the dynamic tagname example can be updated
The text was updated successfully, but these errors were encountered:
I've just updated the example (also in master), and added a unit test (so it doesn't just break unnoticed). There were some underlying fixes/changes in the parser that the dynamic reader was not updated to handle. I've also updated the code to use the new XmlSerializer interface (that extends KSerializer) – this interface makes xml specific serialization easier.
used something based on https://github.com/pdvrieze/xmlutil/blob/master/examples/DYNAMIC_TAG_NAMES.md for a while, but the code in there does not work anymore
this broke with the update t0 0.9.2 (and i have been dragging my feet to update)
how do we apprach this now?
example snippets (no control over the input XML sadly)
and we want to parse this into a structure like this (although if implementation forces a slightly different structure on us we can live with it)
this now breaks with
how do we approach this kind of (awful) XML?
.. and i hope the dynamic tagname example can be updated
The text was updated successfully, but these errors were encountered: