Hello everyone,

We recently started thinking about using Castor to get data from XML
into our already created classes.
We started creating a mapping file that will reflect these mappings.
However, we were unable (didn't know how) to map nested elements into
java fields. We couldn't find any examples that show how this is
achieved. Aside from this problem, how the elements with the same name
that are located in different locations are mapped properly into the
existing class or classes. For example, how is
<telephoneNumber>0000000000</telephoneNumber> in
<customerIdentification> specified in mapping file so it is not confused
with <telephoneNumber>0000000000</telephoneNumber> in
<daytimeTelephoneNumber> element. We don't have classes like
CustomerIdentification or DaytimeTelephoneNumber. We just want this
<telephoneNumber> to map to a String field in a class let's say
BellCaMoveOrderRqst.


Thank you all in advance
Ozrenko Cvoro

Here is a portion of the xml file which elements (not all of them) we
want to read into different classes.

<BellCaMoveOrderRqst>
        <moveRequest>
                <requestHeader>
                        <authentication>
                                <login>String</login>
                                <password>String</password>
                        </authentication>
                        <sourceCoded>bellca</sourceCoded>
                        <originatorCoded>bellca</originatorCoded>
                        <destinationCoded>bellca</destinationCoded>
                
<sourceSystemTimeStamp>2001-12-17T09:30:47-05:00</sourceSystemTimeStamp>
                        <requestType>disconnectService</requestType>
                        <asynchSynchIndr>sync</asynchSynchIndr>
                </requestHeader>
                <orderHeader>
                        <customerIdentification>
                                <telephoneNumber>0000000000</telephoneNumber>
                        </customerIdentification>
                        <initiatedDate>2001-12-17T09:30:47-05:00</initiatedDate>
                        <createOrderModeCoded>create</createOrderModeCoded>
                        <requestedDueDate>1967-08-13</requestedDueDate>
                        <customerIdentification>
                                <telephoneNumber>0000000000</telephoneNumber>
                        </customerIdentification>
                        <contactInfo>
                                <daytimeTelephoneNumber>
                                        <telephoneNumber>0000000000</telephoneNumber>
                                </daytimeTelephoneNumber>
                                <contactName>normalizedString</contactName>
                        </contactInfo>

                <orderHeader>
......
......
        </moveRequest>
......
......
</BellCaMoveOrderRqst>

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

Reply via email to