You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Restamon <re...@restafarian.org> on 2008/02/24 06:09:59 UTC

[Betwixt] XML-to-Java transformation/mapping issue

I have a common structure for a "person" that I use in a number of different
places in my XML, which looks something like this in use:

<author id="XX" xlink:href="XX">XX</author>
<user id="XX" xlink:href="XX">XX</user>
<approver id="XX" xlink:href="XX" otherattr="XX">XX</approver>

I have a Java class called Person.java that has three properties (name, id,
and uri) and the following betwixt mapping:

<info primitiveTypes="element">
    <element property='name'>
        <attribute name='id' property='id'/>
        <attribute name='xlink:href' property='uri'/>
    </element>
</info>

There is no "name" attribute at the highest level, because the "name" could
be author or user or approver, or potentially anything else that might be
needed in the future. This works fine when generating XML from Java;
however, when generating the Java objects from XML, the person data does not
get populated. More information can be found here: 
http://blog.restafarian.org/?p=33 http://blog.restafarian.org/?p=33 .

I'm no expert on Betwixt, so I may have gone about this completely wrong ...
I'd love to hear from someone who actually knows what they're doing who can
tell me what it is that I am doing wrong!


Thanks.
-- 
View this message in context: http://www.nabble.com/-Betwixt--XML-to-Java-transformation-mapping-issue-tp15661004p15661004.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org