users@jaxb.java.net

Re: JAXB 2.1 XML to Java - Changing generated class name for a single XML element

From: Serge Merzliakov <smerz_at_epistatic.net>
Date: Mon, 8 Dec 2008 14:42:57 -0800 (PST)

Wolfgang,
   This works OK.

Thanks,
Serge


Wolfgang Laun-2 wrote:
>
> As an alternative, you might also use inline customization right there in
> the schema type definition, so there is no need for a separate bindings
> file:
>
> <xsd:complexType name="event-register">
> <xsd:annotation>
> <xsd:appinfo>
> <jxb:class name="EventRegisterConfigurations"/>
> </xsd:appinfo>
> </xsd:annotation>
> <xsd:sequence>
> <xsd:element name="..." ... />
> ...
> </xsd:sequence>
> </xsd:complexType>
>
>
> On Mon, Dec 8, 2008 at 8:05 AM, Aleksei Valikov <valikov_at_gmx.net> wrote:
>
>> Hi.
>>
>> > I am trying to configure JAXB 2.1 binding file to generate a
>> different
>> > class name for one element in the schema.
>> > For element called 'event-registry', I want the generated class to be
>> called
>> > EventRegistryConfiguration. For all other elements and type, I want the
>> > default nameing used by JAXB 2.1
>>
>> > Any thoughts on how to control the generated class names for one
>> classes,
>> or
>> > a subset of classes ?
>> >
>>
>>
>> Something like:
>>
>> <jxb:bindings node="//xs:element[@name='event-register']">
>> <jxb:class name="EventRegisterConfiguration"/>
>> </jxb:bindings>
>>
>> Bye.
>> /lexi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
>

-- 
View this message in context: http://www.nabble.com/JAXB-2.1-XML-to-Java---Changing-generated-class-name-for-a-single-XML-element-tp20890301p20905121.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.