users@jaxb.java.net

Re: Problem with BPMI Schema

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 17 Jan 2003 11:39:50 -0800

> An interface with the same name "bpml.instance.Service" is generated from more than one schema component.
> line 35 of BPML-2002-instance.xsd
>
> (Relevant to above error) another one is generated from this schema component. line 37 of BPML-2002-instance.xsd
>
> Failed to parse a schema.

Because of the complexity of XML Schema, it is not a goal for a JAXB
compiler to compile schemas without any customizations. This is one such
case.

As you see, this schema (and a lot of other schemas) uses the same name
for both elements and complex types. For a case like this, a compiler
produces the above error, since both of them produces the same Java
interface name "Service".

The user is expected to solve this conflict by himself/herself by using
a customization. For example, you can apply <jaxb:class name="..."/> to
change class names individually, or you can use nameXmlTransform
customization to change them all at once.

> The <nameXmlTransform> customization allows a suffix and/or a prefix to be
> associated on a per symbol space basis. So for e.g.
>
> <jaxb:schemaBindings>
> <jaxb:nameXmlTransform>
> <typeName prefix="foo" suffix ="bar"/>
> </jaxb:nameXmlTransform>
> </jaxb:schemaBindings>
>
> will attach the prefix "foo" and suffix "bar" to all type definitions since
> they are
> in associated with one symbol space. The above is useful to removing
> collisions in schemas where same XML names
> are used (for e.g. type definitions and elements ).



regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com