Re: [Simple-support] How to ignore unused XML elements while deserializing a document?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-01-19 21:38:31
|
See Persister.read(class, source, false)
--- On Wed, 19/1/11, Cristian <cri...@el...> wrote:
From: Cristian <cri...@el...>
Subject: [Simple-support] How to ignore unused XML elements while deserializing a document?
To: sim...@li...
Received: Wednesday, 19 January, 2011, 1:25 PM
I'm using SimpleXml to (de)serialize POJOs. Now, I
have a big XML which has some elements which are not needed. For
instance, with this XML:
<Root>
<Element>Used</Element>
<Another>Not used</Another>
<Root>
I want to create a POJO which looks like:
@Root
class Root{
@Element
private String element;
}
Problem is that I'm getting this Exception:
simpleframework.xml.core.ElementException: Element 'Another' does not have a
match in class blah.blah.Blah at line 1
So... how should I configure the POJO so that I can parse the XML correctly?
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|