simplexml icon indicating copy to clipboard operation
simplexml copied to clipboard

the element is definited in bean, but the result data from server is not include it.

Open tracy1allen3 opened this issue 9 years ago • 3 comments

how to do like : the element is definited in bean, but the result data from server is not include it.

tracy1allen3 avatar Aug 14 '16 05:08 tracy1allen3

If you put in the @Element(required=false) over the field that should ignore it.

Kisty avatar Aug 16 '16 15:08 Kisty

@Kisty , got it.

And, the other way, if the element is not definited in bean , but the result data has it . it may be error. how to do with this ?

tracy1allen3 avatar Aug 19 '16 01:08 tracy1allen3

Try setting strict mode to false for whichever way you're reading the XML: http://simple.sourceforge.net/download/stream/doc/javadoc/org/simpleframework/xml/core/Persister.html#read(java.lang.Class, java.io.InputStream, boolean)

Kisty avatar Aug 19 '16 09:08 Kisty