xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "O'Hara, Patrick" <patrick.oh...@rwsol.com>
Subject RE: Common schema
Date Fri, 23 Jul 2004 16:24:37 GMT
Thanks I'll give it a try.

-----Original Message-----
From: Coburn Kimberley [mailto:Kimberley.Coburn@softlab.de]
Sent: Friday, July 23, 2004 11:15 AM
To: 'xmlbeans-user@xml.apache.org'
Subject: RE: Common schema

Yes, there is a very easy way to do this. In your ant task, generate a jar file for just your
Common schema; include this jar file in the classpath for the tasks you use to generate the
XmlBeans for all your other schema. Here's how it looks in my build.xml:
<property name="classpath" value="${locallibs}/ehl_nocorba.jar${classpathseparator}



<target name="xmlbeans-subsystem" description="${subsystem}.${component}" unless="generator.xmlbeans.off">

<echo>Running xmlbeans for subsystem ${subsystem} and component ${component}</echo>

<taskdef name="xmlbean" classpath="${wls}/server/lib/xbean.jar" classname="com.bea.xbean.tool.XMLBean"/>

<xmlbean destfile="${generatedlibs}/${subsystem}${component}XmlBeans.jar" srcgendir="${generatedlibs}/gen/src"
classgendir="${generatedlibs}/gen/cls" classpath="${classpath}" typesystemname="holder.${subsystem}">

<fileset dir="${schemadir}/${subsystem}/${component}">

<include name="*.*"/>



<delete dir="${generatedlibs}/gen"/>


The first subsytem generated is the one for the Common subsystem, i.e. the one with all our
common types in it. Subsequent generation tasks for schemas that include the common schema
see the Common types in the CommonSbsXmlBeans.jar on the classpath and don't generate these
types again.


Hope this helps,

Kimberley Coburn

-----Original Message-----
From: O'Hara, Patrick [mailto:patrick.ohara@rwsol.com]
Sent: Freitag, 23. Juli 2004 16:05
To: xmlbeans-user@xml.apache.org
Subject: Common schema

We use XML for almost all of our interaction with external systems.  We are considering using
XMLBeans to handle our XML to Java processing.  I have run into something I need a little
direction on.  We have a Common schema.  This is included in most of our Schemas.  The result
is that each time I make a jar for a new Schema I get a duplicate set of classes for the Common
data types.  This is troubling to me as there is a possibility that these classes may end
up out of sync.  I am wondering if there is a way to tell XMLBeans that classes for part of
the schema (say the parts that are included from a different schema) have already been generated?
 If not that, then is there an alternative approach that I could use to centralize these classes
into a seperate jar?

Pat O'Hara 
Connecture, Inc. 

View raw message