You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Asaf Lahav <as...@gmail.com> on 2007/08/01 16:02:20 UTC

Using existing XmlBean jars when generating new ones

Hi all,

 

The situation is like this.

I have a schema "A" and I generated Xmlbeans for it.

I have another schema "B" that imports schema "A" and references element
definitions of schema "A".

When I generate xmlbeans for schema "B" the jar contains xmlbeans for both
schemas ("A" and "B") all over again.

And then when ever I will have to make changes to schema "A" I will have to
regenerate all the xmlbeans jars using schema "A".

 

Is there a way to use the already generated xml beans without regenerating
all the imported schemas when I generate xml beans for schema "B"?

 

Hope I was clear enough :-).

Thanks in advance,

Asaf

 

 

 


RE: Using existing XmlBean jars when generating new ones

Posted by Asaf Lahav <as...@gmail.com>.
Ok I figured it out... 
Thanks Johannes

-----Original Message-----
From: Johannes Echterhoff [mailto:Johannes.Echterhoff@gmx.de] 
Sent: Wednesday, August 01, 2007 5:19 PM
To: user@xmlbeans.apache.org
Subject: Re: Using existing XmlBean jars when generating new ones

Hi.

Include jar for schema "A" (generated by XMLBeans) on the classpath when 
generating the jar for schema "B". Then you only have the classes for B 
in that jar.

Regards,
Johannes

Asaf Lahav schrieb:
>
> Hi all,
>
> The situation is like this.
>
> I have a schema "A" and I generated Xmlbeans for it.
>
> I have another schema "B" that imports schema "A" and references 
> element definitions of schema "A".
>
> When I generate xmlbeans for schema "B" the jar contains xmlbeans for 
> both schemas ("A" and "B") all over again.
>
> And then when ever I will have to make changes to schema "A" I will 
> have to regenerate all the xmlbeans jars using schema "A".
>
> Is there a way to use the already generated xml beans without 
> regenerating all the imported schemas when I generate xml beans for 
> schema "B"?
>
> Hope I was clear enough J.
>
> Thanks in advance,
>
> Asaf
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Using existing XmlBean jars when generating new ones

Posted by Johannes Echterhoff <Jo...@gmx.de>.
Asaf,

I am generating the bindings with XMLBeans' ant task. Like this:

<?xml version="1.0"?>
<project name="xmlbindings" default="all" basedir=".">

	<!-- ==================================================
	 ==	properties needed for build the XML bindings ==
     ================================================== -->

	<property environment="env" />

	<property name="xmlbeans.generationfolder" value="${basedir}/.xmlbeans" />
	<property name="generated-sources" value="${xmlbeans.generationfolder}/sources" />
	<property name="generated-classes" value="${xmlbeans.generationfolder}/classes" />

	<!-- locations of library-folders -->
	<property name="webinf" value="${basedir}/WebContent/WEB-INF" />

	<property name="libs" value="${webinf}/lib/" />
	<property name="ogc-libs" value="${webinf}/lib/ogc-lib" />

	<!-- locations of OGC-schema-folders -->
	<property name="xsd.location.ogc.basedir" value="D:/work/Schema_SVN" />

	<property name="xsd.location.ogc.wns" value="${xsd.location.ogc.basedir}/swe/trunk/wns/0.0.0" />
	<property name="xsd.location.ogc.ows" value="${xsd.location.ogc.basedir}/ows/trunk/ows/1.0.0" />

	<!-- jar-names for OGC-jars -->
	<property name="jar.name.ogc.wns" value="ogcWnsXBs.jar" />
	<property name="jar.name.ogc.ows" value="ogcOwsXBs.jar" />


	<!-- ================================
	 == initialise the environment ==
     ================================ -->
	<target name="init">
		<available property="xmlbeans.lib" value="${libs}" file="${libs}/xbean.jar" />
		<fail message="You must include the xmlbeans libraries in the lib folder." unless="xmlbeans.lib" />
		<echo message="xmlbeans.lib: ${xmlbeans.lib}" />

		<path id="xmlbeans.path">
			<fileset dir="${libs}" includes="*.jar" />
			<fileset dir="${ogc-libs}" includes="*.jar" />
		</path>
		<taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xmlbeans.path" />
	</target>


	<!-- =======================================================
	 ==	Generate all bindings required by ... ==
     ======================================================= -->
	<target name="all" depends="ogc.ows, ogc.wns" />


	<!-- ===============================
	 == Generate OGC-OWS-bindings ==
     =============================== -->
	<target name="ogc.ows" depends="init">

		<!-- cleanup before generation -->
		<delete failonerror="false" dir="${xmlbeans.generationfolder}" />
		<delete failonerror="false" file="${ogc-libs}/${jar.name.ogc.ows}" />

		<!-- compile schemas -->
		<xmlbean classgendir="${generated-classes}" srcgendir="${generated-sources}" destfile="${ogc-libs}/${jar.name.ogc.ows}" memoryMaximumSize="512m" failonerror="true" nopvr="true" noupa="true" download="true" classpathref="xmlbeans.path">

			<fileset dir="${xsd.location.ogc.ows}">
				<include name="*.xsd" />
			</fileset>

		</xmlbean>

		<!-- cleanup after generation -->
		<delete failonerror="false" dir="${xmlbeans.generationfolder}" />

	</target>


	<!-- ===========================
	 == Generate WNS bindings ==
	 =========================== -->
	<target name="ogc.wns" depends="init, ogc.ows">

		<!-- cleanup before generation -->
		<delete failonerror="false" dir="${xmlbeans.generationfolder}" />
		<delete failonerror="false" file="${ogc-libs}/${jar.name.ogc.wns}" />

		<!-- compile schemas -->
		<xmlbean classgendir="${generated-classes}" srcgendir="${generated-sources}" destfile="${ogc-libs}/${jar.name.ogc.wns}" memoryMaximumSize="512m" failonerror="true" classpathref="xmlbeans.path">
			<fileset dir="${xsd.location.ogc.wns}">
				<include name="**/*.xsd" />
			</fileset>
		</xmlbean>

		<!-- cleanup after generation -->
		<delete failonerror="false" dir="${xmlbeans.generationfolder}" />

	</target>

</project>


What that does is generating the jars for the schemas of 'OWS' and 'WNS' 
(where WNS depends on OWS).

Does that help?

Regards,
Johannes



Asaf Lahav schrieb:
>
> Johannes,
>
> I tried what you suggested using scomp with no luck.
>
> I tried to following command lines:
>
> 1) scomp -compiler C:\jdk1.5.0_06\bin\javac.exe -dl -out t2-xbeans.jar 
> t2.xsd -cp C:\xbeansTest
>
> And also,
>
> 2) scomp -compiler C:\jdk1.5.0_06\bin\javac.exe -dl -out t2-xbeans.jar 
> t2.xsd -cp C:\xbeansTest\t1-xbeans.jar
>
> Am I specifying the class path correctly?
>
> -----Original Message-----
> From: Johannes Echterhoff [mailto:Johannes.Echterhoff@gmx.de]
> Sent: Wednesday, August 01, 2007 5:19 PM
> To: user@xmlbeans.apache.org
> Subject: Re: Using existing XmlBean jars when generating new ones
>
> Hi.
>
> Include jar for schema "A" (generated by XMLBeans) on the classpath when
>
> generating the jar for schema "B". Then you only have the classes for B
>
> in that jar.
>
> Regards,
>
> Johannes
>
> Asaf Lahav schrieb:
>
> >
>
> > Hi all,
>
> >
>
> > The situation is like this…
>
> >
>
> > I have a schema "A" and I generated Xmlbeans for it.
>
> >
>
> > I have another schema "B" that imports schema "A" and references
>
> > element definitions of schema "A".
>
> >
>
> > When I generate xmlbeans for schema "B" the jar contains xmlbeans for
>
> > both schemas ("A" and "B") all over again.
>
> >
>
> > And then when ever I will have to make changes to schema "A" I will
>
> > have to regenerate all the xmlbeans jars using schema "A".
>
> >
>
> > Is there a way to use the already generated xml beans without
>
> > regenerating all the imported schemas when I generate xml beans for
>
> > schema "B"?
>
> >
>
> > Hope I was clear enough J…
>
> >
>
> > Thanks in advance,
>
> >
>
> > Asaf
>
> >
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Using existing XmlBean jars when generating new ones

Posted by Asaf Lahav <as...@gmail.com>.
Johannes,

 

I tried what you suggested using scomp with no luck.

 

I tried to following command lines:

1) scomp -compiler C:\jdk1.5.0_06\bin\javac.exe -dl -out t2-xbeans.jar
t2.xsd -cp C:\xbeansTest

And also,

2) scomp -compiler C:\jdk1.5.0_06\bin\javac.exe -dl -out t2-xbeans.jar
t2.xsd -cp C:\xbeansTest\t1-xbeans.jar

 

Am I specifying the class path correctly?

 

-----Original Message-----
From: Johannes Echterhoff [mailto:Johannes.Echterhoff@gmx.de] 
Sent: Wednesday, August 01, 2007 5:19 PM
To: user@xmlbeans.apache.org
Subject: Re: Using existing XmlBean jars when generating new ones

 

Hi.

 

Include jar for schema "A" (generated by XMLBeans) on the classpath when 

generating the jar for schema "B". Then you only have the classes for B 

in that jar.

 

Regards,

Johannes

 

Asaf Lahav schrieb:

> 

> Hi all,

> 

> The situation is like this.

> 

> I have a schema "A" and I generated Xmlbeans for it.

> 

> I have another schema "B" that imports schema "A" and references 

> element definitions of schema "A".

> 

> When I generate xmlbeans for schema "B" the jar contains xmlbeans for 

> both schemas ("A" and "B") all over again.

> 

> And then when ever I will have to make changes to schema "A" I will 

> have to regenerate all the xmlbeans jars using schema "A".

> 

> Is there a way to use the already generated xml beans without 

> regenerating all the imported schemas when I generate xml beans for 

> schema "B"?

> 

> Hope I was clear enough J.

> 

> Thanks in advance,

> 

> Asaf

> 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org

For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Using existing XmlBean jars when generating new ones

Posted by Johannes Echterhoff <Jo...@gmx.de>.
Hi.

Include jar for schema "A" (generated by XMLBeans) on the classpath when 
generating the jar for schema "B". Then you only have the classes for B 
in that jar.

Regards,
Johannes

Asaf Lahav schrieb:
>
> Hi all,
>
> The situation is like this…
>
> I have a schema "A" and I generated Xmlbeans for it.
>
> I have another schema "B" that imports schema "A" and references 
> element definitions of schema "A".
>
> When I generate xmlbeans for schema "B" the jar contains xmlbeans for 
> both schemas ("A" and "B") all over again.
>
> And then when ever I will have to make changes to schema "A" I will 
> have to regenerate all the xmlbeans jars using schema "A".
>
> Is there a way to use the already generated xml beans without 
> regenerating all the imported schemas when I generate xml beans for 
> schema "B"?
>
> Hope I was clear enough J…
>
> Thanks in advance,
>
> Asaf
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org