users@jaxb.java.net

How to use anytype: get and set value in pojo

From: Martin Grotzke <martin.grotzke_at_javakaffee.de>
Date: Mon, 11 Feb 2008 22:29:39 +0100

Hello,

I have an xmldocument with one element that is of xsd:anyType (the user
must be able to store any xml structure within this element):

    <element name="myDocument">
        <complexType>
            <all>
                <element name="id" type="string" />
                <element name="myData" type="anyType" />
            </all>
        </complexType>
    </element>

I want to read the content of myData when a user submits a document and
store this content in the database. Later, when the user asks me for
this document, I want to create it and set the content of myData to the
previously stored content.

The pojos are created from a schema (using xjc).

What's the best way to achieve this in jaxb?

Thanx a lot in advance,
cheers,
Martin