Is it possible to write a mapping file which modifies the name of the element, which is not the root element ?

 

e.g. if I have the objects, which represent the following XML:

<ROOT1>

   <ROOT2>

      <ABC1> </ABC1>

      <ABC1> <ABC1>

      <XYZ> </XYZ>

      <MNO> </MNO>

      <ABC> </ABC>

      <ABC> </ABC>

    </ROOT2>

</ROOT2>

 

Can I get an XML of the following format:

<ROOT1>

   <ROOT2>

      <ABC> </ABC>  -> convert ABC1 to ABC

      <ABC> <ABC>

      <XYZ> </XYZ>

      <MNO> </MNO>

      <ABC> </ABC>

      <ABC> </ABC>

    </ROOT2>

</ROOT2>

 

This will solve my original problem, where I wanted to sequence the same XML elements in a certain order.

 

thanks

Sunit

 

-----Original Message-----
From: Sunit Bhatia
Sent: Wednesday, July 16, 2003 8:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] sequencing the XML Elements

 

>>split your ABC elements into two separate collection fields

 

Can you please elaborate on this  ? 

Do you mean to split ABC Elements into two new elements e.g. ABC1 and

ABC2 like this:

<ABC1> </ABC1>

<ABC1> <ABC1>

<XYZ> </XYZ>

<MNO> </MNO>

<ABC2> </ABC2>

<ABC2> </ABC2>

 

That would require change in schema for my southbound interface (ie the

application which receives the XML) ?

 

Can you please explain by giving a small example the procedure to do

that ?

 

Thanks

Sunit

 

 

-----Original Message-----

From: Keith Visco [mailto:[EMAIL PROTECTED]

Sent: Tuesday, July 15, 2003 11:30 AM

To: [EMAIL PROTECTED]

Subject: Re: [castor-dev] sequencing the XML Elements

 

 

 

You'll need to use a mapping file, as well as split your ABC elements

into two separate collection fields in order for them to be split like

that.

 

The marshaller will get the fields in the order in which they are

specified in the mapping file.

 

--Keith

 

-----------------------------------------------------------

If you wish to unsubscribe from this mailing, send mail to

[EMAIL PROTECTED] with a subject of:

        unsubscribe castor-dev

 

-----------------------------------------------------------

If you wish to unsubscribe from this mailing, send mail to

[EMAIL PROTECTED] with a subject of:

        unsubscribe castor-dev

 

Reply via email to