Hi Thomas,

I did duplicate and correct this problem. In the process I found a couple of weaknesses in the code, so I also detoured to fix those. The current CVS should work for you.

 - Dennis

thomas montembault wrote:

Hi,
I'm currently working on jibx xml binding.
I've compiled the source from CVS,
to use Include on Windows, but a new pb appears.
Here a simplified sample : data.xml
-------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <EAOE>
    <generiques>
      <type code="0">AAAA</type>
      <foo>0</foo>
      <!-- ... -->
    </generiques>
    <racine>
      <sousEA>true</sousEA>
      <!-- ... -->
    </racine>
  </EAOE>
</root>
In this XML, only element racine is specific to EAOE.
generiques is shared by all domains. At this moment,
we works with 12 domains. In the futur, more than
50 domains are expected.
Example for the domain FOOP : <?xml version="1.0" encoding="UTF-8"?>
<root>
  <FOOP>
    <generiques>
      <type code="0">AAAA</type>
      <foo>0</foo>
      <!-- ... -->
    </generiques>
    <racine>
      <!-- FOOP's data-->
    </racine>
  </FOOP>
</root>
binding.xml :
------------------
<?xml version="1.0" encoding="UTF-8"?>
<binding  name="eaoe">
  <!-- Commons includes with Ant task, Xom and Xcluder ...  -->.
  <mapping name="Ident" label="Ident" class="Ident">
    <value style="text" field="libelle" usage="required"/>
    <value style="attribute" name="code" field="code" usage="required"/>
  </mapping>
  <mapping name="generiques" class="BaseDetail">
    <structure name="type" field="ident" usage="required" using="Ident"/>
    <value style="element" name="foo" field="foo" usage="required"/>
  </mapping>
  <!-- Eaoe binding -->
  <mapping name="root" class="DetailEaoe">
    <structure name="EAOE" usage="required">
      <structure map-as="BaseDetail" usage="required"/>
      <structure name="racine" usage="required">
<value style="element" name="sousEA" field="sousEa" usage="required"/>
      </structure>
    </structure>
  </mapping>
</binding>
java files
-------------
public class Ident {
  int code;
  String libelle;
  // ...
}
public class BaseDetail {
 int foo;
 Ident ident;
// ...
}
public class DetailEaoe extends BaseDetail {
 boolean sousEa;
 // ...
}
With beta3C : it is OK. With the latest from CVS (RC1) : [java] Error: Implicit references to structure object must have types compatible with structure type for structure element at (line 15, col 56, in Sample/exampe1/binding.xml)
 [java] Error running binding compiler
[java] org.jibx.runtime.JiBXException: Binding Sample/example1/binding.xml
 is unusable because of validation errors
 [java]     at org.jibx.binding.Utility.loadBinding(Utility.java:361)
 [java]     at org.jibx.binding.Utility.loadFileBinding(Utility.java:389)
 [java]     at org.jibx.binding.Compile.compile(Compile.java:294)
 [java]     at org.jibx.binding.Compile.main(Compile.java:382)
Change binding generiques to abstract="true" has no effects. and
The basic adaptation like this is ok, but I can't change the xml
data.xml
-------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <generiques>
      <type code="0">AAAA</type>
      <foo>0</foo>
      <!-- ... -->
    </generiques>
    <racine>
      <sousEA>true</sousEA>
      <!-- ... -->
    </racine>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<binding  name="eaoe">
  <!-- Commons includes with Ant task, Xom and Xcluder ...  -->.
  <mapping name="Ident" label="Ident" class="Ident">
    <value style="text" field="libelle" usage="required"/>
    <value style="attribute" name="code" field="code" usage="required"/>
  </mapping>
  <mapping name="generiques" class="BaseDetail">
    <structure name="type" field="ident" usage="required" using="Ident"/>
    <value style="element" name="foo" field="foo" usage="required"/>
  </mapping>
  <!-- Eaoe binding -->
  <mapping name="root" class="DetailEaoe">
      <structure map-as="BaseDetail" usage="required"/>
      <structure name="racine" usage="required">
<value style="element" name="sousEA" field="sousEa" usage="required"/>
      </structure>
  </mapping>
</binding>
Please, Any help would be appreciated.
Thomas Montembault
PS:
  I can post a Zip with the source code, if needed.
  Sorry for my poor english...

------------------------------------------------------------------------
*Appel audio GRATUIT partout dans le monde* avec le nouveau Yahoo! Messenger Téléchargez le ici ! <http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com>




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to