Ah, I think I see now. Allows the structure to be omitted if amount is empty.
Linus Kamb wrote: > just curious... > > Is the field="amount" in the TOTAL_AMOUNT structure definition necessary? It > seems redundant to me. > > Linus > > > Dennis Sosnoski wrote: >> Hi Steve, >> >> Try: >> >> <structure name="Header"> >> <structure name="TOTAL_AMOUNT" field="amount" usage="optional"> >> <value style="attribute" name="currency" field="currency"/> >> <value style="text" field="amount"/> >> </structure> >> </structure> >> >> - Dennis >> >> Dennis M. Sosnoski >> SOA and Web Services in Java >> Training and Consulting >> http://www.sosnoski.com - http://www.sosnoski.co.nz >> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117 >> >> >> >> squirk wrote: >>> 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 > > ------------------------------------------------------------------------- > 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
