Suppose that I have an Exercise class that has a name and description, a
Scenario class that has contains information but am interested in the
path to a JPEG file and then an ExerciseInfo class that would like to
store the name and description from the Exercise class and the path in
the Scenario class.
A sample XML file would be:
<Exercise
description="Test Exercise Description" id="Test Exercise ID"
name="Test Exercise">
<scenario diagram="Blah.jpg">
...
</scenario>
...
</Exercise>
So I was wondering if I am able to create a mapping file that would
allow me to just read in the 'name' and 'description' attribute in the
Exercise tag and the 'diagram' attribute in the scenario tag and place
it into an ExerciseInfo class without me unmarshalling the entire
Exercise class and going into the scenario element and retrieving the
'diagram' attribute.
-Philip Chan
-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 30, 2007 1:08 PM
To: [email protected]
Subject: Re: [castor-user] Unmarshalling question
Can you please be a bit more specific and show us the XML that you want
to unmarshal ? So far your description is a bit .. vague.
Werner
Chan, Philip wrote:
> Hi,
>
> I have 3 classes: A, B and C. Class A has attribute 1, 2 and 3
> while Class B has attribute 4 and 5. Class C has attribute 1, 2 and
5.
>
> My XML file is broken down into Class A and Class B, is it possible
> for me to configure a mapping file that would read in the XML file and
> unmarshal only attributes 1, 2 and 5 and place them into Class C? Any
> help is appreciated.
>
> -Philip Chan
>
> *"This email message is for the sole use of the intended
> recipient(s) and may contain GDC4S confidential or
> privileged information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not
an
> intended recipient, please contact the sender by reply
email
> and destroy all copies of the original message."*
>
>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email