opensubscriber
   Find in this group all groups
 
Unknown more information…

j : jibx-users@lists.sourceforge.net 10 November 2009 • 9:56PM -0500

[jibx-users] flexible=true when child is a collection
by mr.abanjo

REPLY TO AUTHOR
 
REPLY TO GROUP






Hi,
there is a way to have a "parent" tag with flexible= true that have a
collection as child?

Es:

<root>
    <tag1>a</tag1>  <!-- i haven't mapped this tag -->
    <tag2>b</tag2>
    <item>
       <title>c1</title>
    </item>
    <item>
       <title>c2</title>
    </item>
    <item>
       <title>c3</title>
    </item>
</foo>

Mapping:

<binding>
    <mapping name="root" class="Root" ordered="false" flexible="true">
<!-- N.B. i don't map TAG1... i use flexible=true to avoid problem to
unknown tags -->
        <value name="tag2" field="tag2"  usage="optional"/>
               <collection field="items" factory="Root.itemsListFactory"
usage="optional">
                    <structure name="item" type="Item"  ordered="false">
                          <value name="title" field="title"
usage="optional" />
                    </structure>
                </collection>
    </mapping>
</binding>

Flexible=true works fine, but when i have a collection as a child JIBX give
me an error in a compilation phase.
It tell me that all child must have a "name". But collection doesn't have
it.. becouse "name" is declared in the "structure".
How i can tell JIBX to ignore TAG1?

This behaviour is very usefull, because sometime who generate the feed add
new tag ora attribute without advise who read them.

Thanks
Davide

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.