simplexml
simplexml copied to clipboard
the element is definited in bean, but the result data from server is not include it.
how to do like : the element is definited in bean, but the result data from server is not include it.
If you put in the @Element(required=false) over the field that should ignore it.
@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 ?
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)