Hi Dennis,
thanks for the reply.
 
The new code work's very well.
 
I dont' know if my solution is standard, but I found a way for reusing a binding in collection when the name's element are differents. Here a sample :
 
BEFORE :
----------------
 
1 - A simple classe dao.LieuVO with a mapping for a xml element localisation :
<mapping 
  name="localisation"
  label="LieuDecritLabel"
  class="dao.LieuVO">
    <value style="text" field="libelle" usage="required"/>
    <value style="attribute" name="code" field="code" usage="required"/>
</mapping>
 
2 - fragment of xml where entrepot is LieuVO :
...
<entrepots>
  <entrepot code="01234567">entrepot1</entrepot>
  <entrepot code="76543210">entrepot2</entrepot>
</entrepots>
...
 
3 - Old solution :
 public class EntrepotHelper extends LieuVO {}

<mapping>
  name="entrepot"
  label="EntrepotLabel"
  class="implJibx.rent.EntrepotHelper">
    <value style="text" field="libelle" usage="required"/>
    <value style="attribute" name="code" field="code" usage="required"/>
</mapping>
 
and finally :
...
<collection
  field="entrepotList"
  name="entrepots"
  item-type="implJibx.rent.EntrepotHelper"
  usage="required"/>
...
 
 I need a class Wrapper, fields protected  for base classe and a mapping definition.
 
NEW SOLUTION
-------------------------
 
With CVS code, this binding work's without any wrapper's need.
 
<collection field="entrepotList" name="entrepots" usage="required">
  <structure name="entrepot" type="dao.LieuVO" />
</collection>
 
In real code, I test this solution with 3 or 4 level of imbricated collection, and it work's fine.
 
Regards,
thomas

 
Dennis Sosnoski <[EMAIL PROTECTED]> a écrit :
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
> -------------
>
>
>
>
> AAAA
> 0
>
>

>
> true
>
>

>

>

> 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 :
>
>
>
>
>
> AAAA
> 0
>
>

>
>
>

>

>

>
> binding.xml :
> ------------------
>
>
>
> .
>
>
>
>

>
>
>
>

>
>
>
>
>
> > usage="required"/>
>

>

>

>

>
> 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
> -------------
>
>
>
> AAAA
> 0
>
>

>
> true
>
>

>

>
>
> .
>
>
>
>

>
>
>
>

>
>
>
>
> > usage="required"/>
>

>

>

>
> 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 !
>




-------------------------------------------------------
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


Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !

Reply via email to