Hello,
this is not a bug, as the location attribute is
"...always relative to the class in which the field is being defined." [1]
Using:
<mapping>
<class name="xml.template.Atls">
<map-to xml="ATLs" />
<field name="washingAdm" type="string">
<bind-xml name="OnAdmission" node="attribute"
location="Washing" />
</field>
<field name="washingSep" type="string">
<bind-xml name="OnSeparation" node="attribute"
location="Washing" />
</field>
<field name="dressingAdm" type="string">
<bind-xml name="OnAdmission" node="attribute"
location="Dressing" />
</field>
<field name="dressingSep" type="string">
<bind-xml name="OnSeparation" node="attribute"
location="Dressing" />
</field>
<field name="eatingAdm" type="string">
<bind-xml name="OnAdmission" node="attribute"
location="Eating" />
</field>
<field name="eatingSep" type="string">
<bind-xml name="OnSeparation" node="attribute"
location="Eating" />
</field>
</class>
</mapping>
will generate your desired xml. For detailed information, have a look at the
mapping documentation [1].
Regards,
Lukas
[1] http://www.castor.org/xml-mapping.html#6.-Location-attribute
SantiagoA schrieb:
> Hi there,
> I´ve problem with the generated Tags.
>
> in my mapping file i have something like this:
> <field name="washingAdm" type="string">
> <bind-xml name="OnAdmission" node="attribute" location="ATLs/Washing"/>
> </field>
> <field name="washingSep" type="string">
> <bind-xml name="OnSeparation" node="attribute" location="ATLs/Washing"/>
> </field>
> <field name="dressingAdm" type="string">
> <bind-xml name="OnAdmission" node="attribute" location="ATLs/Dressing"/>
> </field>
> <field name="dressingSep" type="string">
> <bind-xml name="OnSeparation" node="attribute" location="ATLs/Dressing"/>
> </field>
> <field name="eatingAdm" type="string">
> <bind-xml name="OnAdmission" node="attribute" location="ATLs/Eating"/>
> </field>
> <field name="eatingSep" type="string">
> <bind-xml name="OnSeparation" node="attribute" location="ATLs/Eating"/>
> </field>
>
> The generated output looks like that:
> <ATLs>
> <Washing OnAdmission="5" OnSeparation="15"/>
> </ATLs>
> <ATLs>
> <Dressing OnAdmission="5" OnSeparation="15"/>
> </ATLs>
> <ATLs>
> <Eating OnAdmission="5" OnSeparation="15"/>
> </ATLs>
>
> Is this a bug or do I something wrong?
> I expected the Washing-, Dressing-, Eating-Tags to be surrounded by just one
> ATL-Tag.
> I´m new to Castor, so any help would be highly apreciated.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email