users@jaxb.java.net

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

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Mon, 8 Dec 2008 10:05:12 +0100

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
>
>