|
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 PS:
I can post a Zip with the source code,
if needed.
Sorry for my poor
english...
|
- [jibx-users] Binding with extends and 'internal' struct... thomas montembault
- Re: [jibx-users] Binding with extends and 'interna... Dennis Sosnoski
- Re: [jibx-users] Binding with extends and 'int... thomas montembault
- Re: [jibx-users] Binding with extends and ... Dennis Sosnoski
- [jibx-users] Binding with extends and 'internal' s... Thomas MONTEMBAULT
