Hello,

I need some help mapping the following xml sample:

<contentGroup id="1">

<entryTemplate id="1">Test</entryTemplate>

</contentGroup>

I want to do it in the following way, by creating only one class. However it does not 
work, why not?

<?xml version="1.0"?>

<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version 1.0//EN" 

"C:/COTWorkspace2/ewwcms_web/Web Content/config/mapping.dtd">

<mapping>

<description>ContentGroupDetailsTO mapping file</description>

 

<class name="com.cot.ewwcms.domain.transferobject.RequestInputProperties" 
auto-complete="false">

<map-to xml="contentGroup" />

<field name="id" direct="true" type="string" required="true">

<bind-xml name="id" node="attribute" />

</field>

<field name="entryTemplate" direct="true" type="string" required="true">

<bind-xml name="entryTemplate" node="element" />

</field>

<field name="entryTemplateId" direct="true" type="string" required="true">

<bind-xml name="id" location="entryTemplate" node="attribute" />

</field>

</class>

 

</mapping>

This solution, on the other hand, works. However, it 

Requires me to create more classes, which I don't want:

<?xml version="1.0"?>

<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version 1.0//EN" 

"C:/COTWorkspace2/ewwcms_web/Web Content/config/mapping.dtd">

<mapping>

<description>ContentGroupDetailsTO mapping file</description>

 

<class name="com.cot.ewwcms.domain.transferobject.RequestInputProperties" 
auto-complete="false">

<map-to xml="contentGroup" />

<field name="id" direct="true" type="string" required="true">

<bind-xml name="id" node="attribute" />

</field>

<field name="entryTemplate" direct="true" 
type="com.cot.ewwcms.domain.transferobject.RequestInputTemplate" required="true">

<bind-xml name="entryTemplate" />

</field>

</class>

<class name=""com.cot.ewwcms.domain.transferobject.RequestInputTemplate">

<field name="entryTemplateId" direct="true" type="string" required="true">

<bind-xml name="id" node="attribute" />

</field>

<field name="entryTemplate" direct="true" type="string" required="true">

<bind-xml node="text" />

</field>

</class>

 

</mapping>

 

Please advise me how I can do the mapping by only using one class.

Thankyou, (email me back directly)

Anna Kerekes

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

Reply via email to