Hello,

ok, I try it again:

There are two Elements in my XML-File:

<kategorie id="kat-1">Animals</kategorie>
...
<artikel kategorie="kat-1">Dog</artikel>

How to describe this relationship in mapping.xml. I tried

<class cst:name="Artikel" cst:access="shared">
    <field cst:name="kategorie" cst:type="Kategorie">
        <bind-xml cst:name="kategorie" cst:node="attribute"
reference="true"/>
    </field>
    ...
</class>

Java-Code looks like:

class Artikel implements Serializable {
    private Kategorie _kategorie;
    public getKategorie() {
        return _kategorie;
    }
    public setKategorie(Kategorie k) {
        _kategorie = k;
    }
}

But this doesn't work.
I also tried to make the property kategory an Object, but nothing happend.
In some cases unmarshalling goes well, but marshalling inserts the result of
Kategorie.toString() into the attribute kategorie from artikel (<artikel
kategorie="Animals"> instead of <artikel kategorie="kat-1">).

I really need some advice. I can't find any documentation about this.

Thanks,
Thomas

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to