Alex,
Not without some work. You might be able to get it to marshal the way you want
it to by writing an XMLClassDescriptor for your object that maps to
<relationships>. However you'll probably end up having a hard time getting it to
work, and it would be difficult during the unmarshalling process as well.
One solution that should work is to produce the XML as such:
<relationship name="rel-a" .../>
and then use an a very simple XSLT stylesheet to convert the resulting XML to
the format that is needed.
Then do the reverse transformation if you need to unmarshal.
--Keith
[EMAIL PROTECTED] wrote:
Is it possible to map an element name to a field's value in a class
instead of class name?
For example, I want to map Java classes to the following xml:
<people>
:
<relationships>
<rel-a ...> ... </rel-a>
<rel-b ...> ... </rel-b>
:
:
<rel-xxx> </rel-xxx>
</relationships>
</people>
One way is to use the "location" attribute in "bind-xml" element to
list all relationships. But this results in a long public variable
lists and big mapping file. I know I can create a class for relationship
and map to the following:
<people>
:
<relationships>
<relationship name="rel-a" ..> .... </relationship>
<relationship name="rel-b" ..> .... </relationship>
:
</relationships>
</people>
But I kind of stuck with the XML format that was given to me.
Thanks a lot for the help and a great product!
--
Alex Lee
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------