Re: [Simple-support] Deserialize any element (xsd:any)
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2014-11-09 12:14:27
|
Hi,
Check out the tutorial, it should have the details you need.
Niall
--------------------------------------------
On Sat, 8/11/14, Christian Schudt <chr...@gm...> wrote:
Subject: [Simple-support] Deserialize any element (xsd:any)
To: sim...@li...
Received: Saturday, 8 November, 2014, 10:12 AM
Hi all,
I am trying to deserialize an XML String to an object.
The problem I am having is that the object can have *any*
element (xsd:any).
I tried it that way:
@Root
public class Container
{
@Element(required = false)
private Object anyElement;
}
But when deserializing the following XML:
<container><xyz
xmlns=„any_arbitrary_namespace“/></container>
I get a org.simpleframework.xml.core.ElementException:
Element ‚xyz' does not have a match in class…
I have a class which would map to the xyz element.
I also thought, that I have to register it (similar to
creating a JAXBContext), so that the persister is aware of
it, like:
registry.lookup(Xyz.class);
but I doesn’t work.
Here’s the same question:
http://stackoverflow.com/questions/26361729/simplexml-any-element-matching
Thanks for help,
Christian
------------------------------------------------------------------------------
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|