Hey folks! Does anyone have experience with Simple...
# getting-started
p
Hey folks! Does anyone have experience with SimpleXML? I'm trying to parse XML into an object but getting some errors.
m
Some. What's the question?
👍 1
p
I’m getting an error that prevents my code to parse my xml to a class. This is the error:
Unable to satisfy @org.simpleframework.xml.Element(name="LogischeRitDeelNummer", type=java.lang.String.class, data=false, required=true) on field 'LogischeRitDeelNummer' public java.lang.String io.gerrist.kotlintrain.parsers.LogischeRitDeel.LogischeRitDeelNummer for class io.gerrist.kotlintrain.parsers.LogischeRitDeel at line 1
The relevant XML: Paste
And the classes: Paste
m
Those links don't show anything
p
Should be fixed right now @MarkRS
m
Yes. Hmm, in fact I've mostly dealt with simpleXML from PHP. I would say there's a lot in that XML that doesn't seem to be in your classes, though.
p
I thought that XML that don’t have classes would just be ignored, as the error I receive has a different scoped error
m
I wouldn't think so. Particularly as the classes you've implemented are a level down. I might (easily) be wrong. With the Kotlin json deserialisation it can be told to ignore missing parts, perhaps that works here too? Otherwise I'm surprised if this works "as is".