dev@jaxb.java.net

Re: Customizing AnyType Package

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 29 Apr 2005 14:54:42 -0700

In the future please direct questions like this to the users list.

Scott Kaszyk wrote:
> I’m using a binding file similar to the one in the ubl example. However, when I
> generate jaxb classes, an AnyType class is created in a org.w3._2001.xmlschema
> package. Since this class is not explicitly associated with a schema, how do I
> customize the package it ends up in without a schemaLocation?

It's ugly, but you can write a schema like this:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.w3.org/2001/XMLSchema"
    xmlns:jaxb="..." jaxb:version="1.0">

   <annotation><appinfo>
     <jaxb:schemaBindings>
       <jaxb:package>foo.bar</jaxb:package>
     </
   </ ></ >
</schema>

And submit that with your schema for the compilation.

In 2.0 we won't be generating that ugly org.w3._2001.xmlschema package,
so this whole problem will go away.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com