Hi Todd,
The Java class structure really doesn't matter much for this. You want
to use <value ... style="text".../> for the content of the totalCost
element, so something along these lines should work with your classes:
<structure name="totalCost" get-method="getMoney" ...>
<value style="attribute" name="currency" get-method="getCurrency"/>
<value style="text" get-method="getAmount"/>
</structure>
- Dennis
Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
On 09/30/2011 10:36 AM, Todd Bittner wrote:
Hi, I'm trying to marshall some XML that looks like this:
<result>
...
<totalCost currency="USD">20.00</totalCost>
...
</result>
but have only been able to generate the following XML:
<totalCost currency="USD">
<amount>20.00</amount>
</totalCost>
My java model looks something like this:
public class Result {
...
private Money totalCost;
...
}
and
public class Money {
...
private String currency;
private String amount;
...
}
So, I guess what I want to is to flatten the <amount/> element into a
simple text() representation rather than have the element explicitly
represented. I've tried every possible combination of attributes in
my custom.xml before calling bindgen, including things like
"form='simple', but I always run into the same basic issue. Is there
any way to include the parent element with the attribute and text
without having to generate a child element?
Thanks,
Todd
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users