Hello Werner

Thank you very much for your advice (nested binding definition). It solved my 
problem.

The example of the mapping file in my email wasn't correct. I made a mistake in 
the name attribute as I wrote the email. The correct expression for the 
attribute should be "A/B". 

Regards
Christian

-----Ursprüngliche Nachricht-----
Von: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 21. Februar 2006 21:50
An: [email protected]
Betreff: Re: [castor-user] [XML] Sourcecode generator mapping problem


Christian,

should the second <elementBinding> actually read

<elementBinding name="A/B">
  <java-class name="BClass"/>
</elementBinding>

as the element B is defined withi the complexType/element definition of A ?

If that does not make a difference, you could try a nested element binding 
definition along the lines of

<?xml version="1.0" encoding="UTF-8"?>
<binding>
        <elementBinding name="A">
                <java-class name="AClass"/>
                <elementBinding name="B">
                        <java-class name="BClass"/>
                </elementBinding>
        </elementBinding>
</binding>

Regards
Werner


Zeiler Christian, Bedag wrote:
> Hello
> 
> I've the following schema and I want to use the source generator 
> (version 0.9.9.1) with a mapping file. What I want to do is to create 
> a java class with the name AClass for the element A and a java class 
> with the name BClass for the element B. My mapping file works perfect 
> for element A but the generator doesn't generate the java class with 
> the desired name for the element B. It just creates a class with the 
> name of the element (B). I tried many different ways but I couldn't 
> figure out how to force the generator to create a java class with the 
> name BClass for B.
> 
> I would really appreciate it if somebody can help me.
> 
> Best regards
> Christian
> 
> -----------------------------------------------------------------
> Schema file:
> -----------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>       <xs:element name="A">
>               <xs:complexType>
>                       <xs:sequence>
>                               <xs:element name="B">
>                                       ...
>                       </xs:sequence>
>               </xs:complexType>
>       </xs:element>
> </xs:schema>
> -----------------------------------------------------------------
> Mapping file:
> -----------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <binding>
>       <elementBinding name="A">
>               <java-class name="AClass"/>
>       </elementBinding>
>       <elementBinding name="B/A">
>               <java-class name="BClass"/>
>       </elementBinding>
>       -->
> </binding>
> -----------------------------------------------------------------
> 
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to