No.
In your <mapping/>, add a <value/> without the "name" attribute, and with a
style="text" attribute.
ex :

<mapping name="Order" class="Order">
    <value name="amount" field="amount" usage="optional" style="attribute"
/>
    <value field="selfValue" usage="optional" style="text" />
</mapping>

this should produce :
{Order}.setAmount("foo");
{Order}.setSelfValue("bar");

<Order amout="foo">bar</Order>


2008/4/17, squirk <[EMAIL PROTECTED]>:
>
>
> I'm trying to figure out how to map something like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Order>
>    <Header>
>       <TOTAL_AMOUNT currency="USD">3.14</TOTAL_AMOUNT>
>     </Header>
> </Order>
>
> That is, the TOTAL_AMOUNT with the currency and the content.
>
> I've tried different combinations of structure bindings but haven't had
> success - for example:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <binding>
>    <!-- order header -->
>    <mapping name="Order" class="Order">
>      <structure name="Header">
> <!--      <value name="TOTAL_AMOUNT" field="amount" usage="optional"/> -->
>        <structure name="TOTAL_AMOUNT" usage="optional">
> <!--    <value name="" field="amount" usage="optional"/> -->
>          <value name="currency" field="currency" usage="optional"
> style="attribute"/>
>        </structure>
>      </structure>
>    </mapping>
> </binding>
>
>
> Is it possible to map an element with an attribute and content or do I
> need to include a child element with the amount?
>
> Thanks,
> Steve
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to