users@jaxb.java.net

Re: Multiple Schemas

From: Hank Ratzesberger <hankr_at_crustal.ucsb.edu>
Date: Fri, 9 Jan 2004 08:59:27 -0800

I create one XSD file that includes all the others I use, and
.xjc file to adjust prefix/suffix etc., as necessary. Then
I generate the classes once.

I bother to rename the runtime class to something simpler, which
is fairly automatic in Eclipse, and I move it to a part of the
project that is under version control. (I dont' keep generated
classes in version control, at least while I am developing.)

Below is an ant snippet (I should update my arg to the new style):


<target name="generate" depends="prepare">
  <java jar="${jwsdp.home}/jaxb/lib/jaxb-xjc.jar" fork="true" failonerror="true">
    <arg line="-d ${generated.dir} -use-runtime jaxb.runtime -extension -nv -b ${xsd.dir}/generate.xjb
${xsd.dir}/generate.xsd"/>
    <!-- -d ${generated.dir} -extension -nv -b ${xsd.dir}/generate.xjb ${xsd.dir}/generate.xsd -->
    <classpath>
      <fileset dir="${jwsdp.home}/jaxb/lib" includes="*.jar" excludes="ant.jar"/>
      <fileset dir="${jwsdp.home}">
        <include name="jaxp/**/*.jar"/>
        <include name="jwsdp-shared/lib/**/*.jar"/>
      </fileset>
    </classpath>
  </java>
</target>

Best,
Hank

============================================
Replying to a list? I'll get my copy there!

Hank Ratzesberger
http://crustal.ucsb.edu/ | http://neesgrid.org/
Institute for Crustal Studies
University of California, Santa Barbara
============================================


----- Original Message -----

> Hello all,
>
> I'm so excited about JAXB, what a wonderful way to deal with XML and
> stay close to the Java! I had compiled the samples a while back and
> have been busy getting data together for schemas ever since.
>
> When I compiled the samples in JAXB 1.0 it seemed to me that multiple
> runtime packages were created, one per schema. What I have in mind is
> to have multiple schemas for a number of parts in the application, the
> more the merrier. The thing not yet clear to me is why duplicate
> runtime packages are generated and also how large the resulting code
> might be when using multiple schemas?
>
> Also if there are new tutorials that can shed light on how to generate
> and re-generate schemas at anytime while not messing with code
> implemented from the generated interfaces that would be helpful as well.
>
> PS. By the way, how is the SVG schema compiling with JAXB now?
>
> There is much to learn and do,
>
> Thom
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net