Or can you add a XML name suffix to our binding file, just for the sake
of testing ?
Werner
Xavier Naud wrote:
> Hi,
>
> I am using maven2 with the castor plugin 1.0 and a dependency on castor
> 1,1M2 to generate some beans from a XSD. my XSD define complex types and
> elements that have the same name. I tried to defined a binding file to
> change the name of the java classes but it does not work.
>
> below are my maven plugin def + config, the binding file and the generated
> code:
>
> Plugin:
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>castor-maven-plugin</artifactId>
> <version>1.0</version>
> <configuration>
> <schema>
>
> ${basedir}/src/main/castor/FlightHistoryFeedSchema.xsd
> </schema>
> <packaging>
> mypackage.flightstats.data
> </packaging>
> <bindingfile>
>
> ${basedir}/src/main/castor/binding.xml
> </bindingfile>
> <properties>
>
> ${basedir}/src/main/castor/castorbuilder.properties
> </properties>
> <verbose>true</verbose>
> <warnings>true</warnings>
> <types>j2</types>
> </configuration>
> <executions>
> <execution>
> <goals>
> <goal>generate</goal>
> </goals>
>
> </execution>
> </executions>
> </plugin>
>
> extract of my binding file (I tried with and without the / for complexType):
>
> <elementBinding name="/complexType:Airline">
> <java-class name="AirlineVO">
> </elementBinding>
>
> The XSD:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ns="http://myNamespace.xsd/mySchema.xsd"
> targetNamespace="http://myNamespace.xsd/mySchema.xsd"
> elementFormDefault="qualified">
> <xsd:complexType name="Airport">
> <xsd:attribute name="AirportCode" type="xsd:string"
> use="optional" />
> <xsd:attribute name="IATACode" type="xsd:string" use="optional"
> />
> <xsd:attribute name="ICAOCode" type="xsd:string" use="optional"
> />
> <xsd:attribute name="FAACode" type="xsd:string" use="optional"
> />
> <xsd:attribute name="Name" type="xsd:string" use="optional" />
> </xsd:complexType>
> <xsd:complexType name="FlightScheduleEntry">
> <xsd:sequence>
> <xsd:element name="Airline" type="ns:Airline" />
> ...
> <xsd:sequence>
> <xsd:complexType
> </xsd:schema>
>
>
> Generated code:
>
> public class Airline extends Airline implements java.io.Serializable
> { ...
> }
>
> Thanks for helping
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email