users@jaxb.java.net

DTD to JAXB2 compilation problem

From: Jan Dittberner <jan.dittberner_at_t-systems-mms.de>
Date: Wed, 29 Aug 2007 18:01:44 +0200

Hello,

I have trouble generating JAXB code for a DTD element with mixed content
with XJC. All other elements of the DTD get generated correctly.

This is the DTD snippet for the element that causes the trouble and its
children:

<!ELEMENT FIELD (#PCDATA|sep|key)*>
<!ATTLIST FIELD
          NAME CDATA #REQUIRED>
<!ELEMENT key (#PCDATA)>
<!ELEMENT sep EMPTY>

The generated code contains a value property:

    @XmlValue
    protected String value;

Is there any way to specify a rule in the binding mapping to generate
code like this:

    @XmlMixed
    @XmlElementRefs({
        @XmlElementRef(name = "key", type = Key.class),
        @XmlElementRef(name = "sep", type = Sep.class)
    })
    protected List < Serializable > value;

which would be "The right thing" (TM) :-)

If this is not possible, how can I provide an own implementation for
just this one class instead of the generated code?


Regards,
Jan Dittberner

-- 
T-Systems Multimedia Solutions GmbH
Information Service Portals
Jan Dittberner
Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0
Sun Certified Web Component Developer for the Java 2 Platform,
Enterprise Edition 1.4
Hausanschrift: Riesaer Strasse 5, 01129 Dresden
Postanschrift: Postfach 10 02 24, 01072 Dresden
Bitte beachten Sie meine neue Telefonnummer: +49 351 2820-2737
Email: Jan.Dittberner_at_mms-dresden.de
Internet: http://www.t-systems-mms.com
Aufsichtsrat: Helmut Binder (Vorsitzender)
Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
Handelsregister: Amtsgericht Dresden (HRB 11433), Sitz der Gesellschaft
Dresden
Ust-IdNr.: DE 811 807 949