cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: JAXB class name customization
Date Mon, 06 Dec 2010 19:09:15 GMT
On Monday 06 December 2010 6:20:51 am Bruno Dusausoy wrote:
> On Mon, 06 Dec 2010 10:04:12 +0100, Bruno Dusausoy
> <bruno.dusausoy@yp5.be> wrote:
> 
> [...]
> 
> > Well, you were right, kinda ;).
> > My XPath expression was ok, but I had to add a child condition to it,
> > 
> > like this :
> >     <jaxb:bindings
> > 
> > schemaLocation="xml/schema/Loopbaan/B2BExchanges_V1.xsd"
> > 
> > node="//xs:complexType[@name='Response74LSignalStruct']//xs:element[@name
> > ='Activities']/xs:complexType">
> > 
> >             <jaxb:class name="ResponseActivities"/>
> >     
> >     </jaxb:bindings>
> > 
> > The "/xs:complexType" at the end is what was missing.
> > 
> > Everything's ok now.
> > 
> > Thanks.
> 
> By the way, can someone tell me why the aforementioned solution works ?
> Why must I add "/xs:complexType" at the end of the XPath expression ?
> 
> I like to know the why's :).

Well, in JAXB, the generated classes represent the TYPES in the schema.   You 
can have JAXB also generate classes for the Elements (that would then subclass 
JAXBElement), but normally the generated code just represents the types.  The 
complexType thing above makes the customization properly apply to the type.


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message