Hi,
    Is anyone else having this problem using flexible attribute? It is
really starting to kill me now. 
    Basically I'am trying to unmarshal an XML structure that could have
extra elements that I would like to ignore.
 
My Binding
<?xml version="1.0"?>
<binding track-source="true" 
         direction="input" >
   <mapping name="person" class="jibxtest.Person" 
             ordered="false">
      <value name="name" field="name"/>
      <structure name="demographics" 
                 ordered="false" flexible="true" usage="optional" >
            <structure name="resAddress" field="resAddress"
                       map-as="Address"
                       usage="optional"  ordered="false" flexible="true"
/>
            <structure name="officeAddress" field="officeAddress"
                       map-as="Address"
                       usage="optional"  ordered="false" flexible="true"
/>
      </structure>
   </mapping>
   <mapping abstract="true" class="jibxtest.Address" 
            type-name="Address"
            flexible="true" ordered="false">
      <value field="street" name="street" usage="optional" />
      <value field="zip" name="zip" usage="optional" />
      <value field="city" name="city" usage="optional"  />
   </mapping>
</binding>
 
My input XML 
<person>
   <name>Mark</name>
   <demographics>
       <resAddress>
       <extra-element>JUNK</extra-element>
       <street>123 Main Street</street>
         <zip>12345</zip>
       <city>San Jose</city>
       </resAddress>
       <officeAddress/>
   </demographics>
</person>
 
   I donot have any response on the bug report I posted on JIRA either.
   You can find more precise information on the JIRA website
http://jira.codehaus.org/browse/JIBX-175 . The Zip file here has the
sample code, build file and everything.
 
   We are heading to QA and I woud really really appreciate a work
around or some way out for this issue.
 
Thanks
Sowjanya
 
 
 

        -----Original Message-----
        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Janga,
Sowjanya
        Sent: Sunday, July 22, 2007 9:09 PM
        To: JiBX users
        Subject: RE: [jibx-users] Structure with flexible=true is not
ignoring extra elements.
        
        
        
        Thanks a lot for your reply Dennis. I'am using JIBX 1.1.5 and
j2sdk1.4.2_11. 
        I did enter a Jira(JIBX-175). It has a zipped version of my
eclipse project and sample data for bother cases and an ANT build file
that run those tests. 
        I will be more than happy to give you any other information
regarding this.
         
        Sowjanya

________________________________

        From: [EMAIL PROTECTED] on behalf of
Dennis Sosnoski
        Sent: Sun 7/22/2007 6:08 AM
        To: JiBX users
        Subject: Re: [jibx-users] Structure with flexible=true is not
ignoring extra elements.
        
        

        Hi Sowjanya,
        
        I don't see anything wrong with this offhand, but it's possible
that
        something is going wrong in the generated code. Are you using
the 1.1.5
        release of JiBX? If not, please try with that. If you *are*
using 1.1.5,
        please enter a Jira at
        http://jira.codehaus.org/secure/BrowseProject.jspa?id=10410
(you'll need
        to create an account on the Jira system) and attach a zip of
your
        project, including an Ant build that includes a test run.
        
        Thanks,
        
          - Dennis
        
        Dennis M. Sosnoski
        SOA and Web Services in Java
        Training and Consulting
        http://www.sosnoski.com <http://www.sosnoski.com/>  -
http://www.sosnoski.co.nz <http://www.sosnoski.co.nz/> 
        Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
        
        
        
        Janga, Sowjanya wrote:
        >
        > Hi,
        >    Does anyone has any work around or solution(or a mistake in
what I
        > did) for the following problem that has been eating me away
since days.
        >
        >    I'am getting runtime errors when I try to unmarshal any
extra
        > elements under a flexible structure.
        >    The error is not even consistent. If the extra element
happens to
        > occur somewhere after a defined element  ex: after <street>,
it goes
        > in fine but if the extra element happens to be the first
element it
        > gives Expected "resAddress" end tag, found "extra-element"
start tag
        >
        > My Binding
        > <?xml version="1.0"?>
        > <binding track-source="true"
        >          direction="input" >
        >         <mapping name="person" class="jibxtest.Person"
        >              ordered="false">
        >                 <value name="name" field="name"/>
        >                 <structure name="demographics"
        >                            ordered="false" flexible="true"
        > usage="optional" >
        >                       <structure name="resAddress"
field="resAddress"
        >                                  map-as="Address"
        >                                  usage="optional"
ordered="false"
        > flexible="true" />
        >                       <structure name="officeAddress"
        > field="officeAddress"
        >                                  map-as="Address"
        >                                  usage="optional"
ordered="false"
        > flexible="true" />
        >                 </structure>
        >         </mapping>
        >         <mapping abstract="true" class="jibxtest.Address"
        >                  type-name="Address"
        >                  flexible="true" ordered="false">
        >                 <value field="street" name="street"
usage="optional" />
        >                 <value field="zip" name="zip" usage="optional"
/>
        >                 <value field="city" name="city"
usage="optional"  />
        >         </mapping>
        > </binding>
        > 
        > ex:
        > Input causing error
        > <person>
        >         <name>Mark</name>
        >         <demographics>
        >             <resAddress>
        >             <extra-element>JUNK</extra-element>
        >             <street>123 Main Street</street>
        >          <zip>12345</zip>
        >                  <city>San Jose</city>
        >             </resAddress>
        >             <officeAddress/>
        >         </demographics>
        > </person>
        >
        > Input that goes in fine.
        > <person>
        >         <name>Mark</name>
        >         <demographics>
        >             <resAddress>
        >             <street>123 Main Street</street>
        >             <extra-element>JUNK</extra-element>
        >          <zip>12345</zip>
        >                  <city>San Jose</city>
        >             </resAddress>
        >             <officeAddress/>
        >         </demographics>
        > </person>
        >
        >       I have been struggling with this issues for days now and
I'am
        > getting pretty close to my deadline. I would really appreciate
if
        > anyone has a solution or workaround for this kind of a
problem.
        >
        > Thanks
        > Sowjanya
        >
        >
------------------------------------------------------------------------
        >
        >
------------------------------------------------------------------------
-
        > This SF.net email is sponsored by: Microsoft
        > Defy all challenges. Microsoft(R) Visual Studio 2005.
        > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
        >
------------------------------------------------------------------------
        >
        > _______________________________________________
        > jibx-users mailing list
        > jibx-users@lists.sourceforge.net
        > https://lists.sourceforge.net/lists/listinfo/jibx-users
        >  
        
        
------------------------------------------------------------------------
-
        This SF.net email is sponsored by: Splunk Inc.
        Still grepping through log files to find problems?  Stop.
        Now Search log events and configuration files using AJAX and a
browser.
        Download your FREE copy of Splunk now >>  http://get.splunk.com/
        _______________________________________________
        jibx-users mailing list
        jibx-users@lists.sourceforge.net
        https://lists.sourceforge.net/lists/listinfo/jibx-users
        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to