You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jim the Standing Bear <st...@gmail.com> on 2008/03/14 21:46:43 UTC

trouble importing pre-compiled schemas

Hello,

I am having trouble importing pre-compiled schemas.  Xmlbean keeps
generating redundant beans for the imported schema and includes them
into the typelib jar rather than relying on the pre-compiled jars.
Below are the details:

my.xsd file is in <PROJ_DIR>/config directory, and it has this line:

    <xsd:import
namespace="http://our.org/namespaces/2008/02/other/types"
schemaLocation="import/other_types.xsd"/>

other_types.xsd is present in <PROJ_DIR>/config/import

The pre-compiled jar generated from other_types.xsd is present in the
lib/other_types/othertypes.jar, along with all the jars needed for the
project.  This lib directory is assigned an id of "common_libraries"
so that it can be referenced anytime when the classpath is needed.

my .xsdconfig file maps other types' namespace to

org.our.other.types

and maps my.xsd's namespace to

or.our.my.project.types

The xmlbean ant task is defined as follows:

   	    <taskdef name="xmlbean"
classname="org.apache.xmlbeans.impl.tool.XMLBean">
   	        <classpath refid="common_libraries"/>
   	    </taskdef>

   	    <xmlbean classgendir="${generated_build_classes}"
   	             srcgendir="${src_generated_xmlbeans}"
   	             failonerror="true"
   	    	     destfile="${generated_xmlbeans_typelib_jar}"
   	    	     classpathref="common_libraries">
   	        <!-- classpath refid="common_libraries"/-->
   	        <fileset dir="config">
   	        	<exclude name="import/*"/>
   	    	</fileset>
   	    </xmlbean>


However, everytime I do this ant target, xmlbean generates its own
redundant version of other_types classes along with the beans classes
from my.xsd and includes them into the generates_xmlbeans_typelib_jar.
 Even when I told it to exclude anything from the import directory, it
didn't help.  What did I do wrong?  What I want is to have xmlbean
only generate beans classes from my.xsd because the other types are
already present in the classpath.  Thanks.

-- Jim

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