You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jean-Christophe Pazzaglia <Je...@eurecom.fr> on 2004/07/23 15:57:15 UTC

Extension and compilation with ant

Hi,

Using castor we were investigating to switch to XMLBean
since it exhibits quite nice features (namely xpath access
and xget function which may be useful).

Obviously we did find the 'current' xpath limitation regarding
namespace (BTW why it is not in the FAQ ? any idea when you'll be able
to fix it ?) but we also have some problems playing with the ant task
while using extension (ie StaticHandler).

Althought I managed once to compile it with scomp, I had some problems
using ant task :
how do I have to play with the srcdir, gendir, classpath, etc to
enable to compile with this kind of hierarchy ?
more precisely where is the xmlbean task looking for the
ExtensionInterface.java (or maybe .class ???)


/project
    /lib
        xbean.jar ...
    /schema
        myschema.xsd
        myschema0_xsdconfig // without extension
        myschema1_xsdconfig // with extension
    /src/my/schema/extension
       ExtensionInterface.java
       ExtensionInterfaceStaticHandler.java
    /generated/my/schema/extension
       Generation result (aka .java)
    /bin/
       Compilation result (.class)


I tried different solution without success :


generate:
     [copy] Copying 1 file to E:\eclipse\workspace\XMLBeanMail\src\my\schema
     [copy] Copying 1 file to E:\eclipse\workspace\XMLBeanMail\src\my\schema
  [xmlbean] Time to build schema type system: 1.422 seconds
  [xmlbean] Time to generate code: 0.411 seconds
  [xmlbean] Compiling 15 source files to 
E:\eclipse\workspace\XMLBeanMail\bin
  [xmlbean] Note: Some input files use or override a deprecated API.
  [xmlbean] Note: Recompile with -deprecation for details.
  [xmlbean] Time to compile code: 3.224 seconds
     [copy] Copying 1 file to E:\eclipse\workspace\XMLBeanMail\src\my\schema
  [xmlbean] src/my/schema/myschema.xsdconfig:0: error: Interface 
'my.schema.extension.ExtensionInterface' not found.
  [xmlbean] src/my/schema/myschema.xsdconfig:0: error: Interface 
'my.schema.extension.ExtensionInterfaceHandler' not found.
  [xmlbean] Time to build schema type system: 0.17 seconds
  [xmlbean] BUILD FAILED

with this build
<project default="generate">
    <!-- Work only if there is no extension defined ... -->
    <property name="project" 
value="E:\eclipse\workspace\XMLBeanMail"></property>
    <property name="xmlbeanlib" 
value="E:\Java\xmlbeans-1.0.3\lib"></property>
    <taskdef name="xmlbean" 
classname="org.apache.xmlbeans.impl.tool.XMLBean">
        <classpath>
            <fileset dir="${xmlbeanlib}">
                <include name="**/*.jar" />
            </fileset>
        </classpath>
    </taskdef>
   
    <path id="compile-path">
        <fileset dir="${project}/lib">
                <include name="**/*.jar" />
        </fileset>
        <fileset dir="${xmlbeanlib}">
                <include name="**/*.jar" />
        </fileset>
        <fileset dir="${project}/bin">
            <include name="**/*" />
        </fileset>       
    </path>
   
    <target name="generate">
        <copy file ="${project}/schema/myschema0_xsdconfig"
            tofile="${project}/src/my/schema/myschema.xsdconfig"
            overwrite="true"/>
        <copy file ="${project}/schema/myschema.xsd"
            todir="${project}/src/my/schema/"
            overwrite="true"/>
        <xmlbean
            classpathref="compile-path"
            srcgendir="${project}/generated"    
            classgendir="${project}/bin"
            schema="${project}/schema"/>
        <copy file ="${project}/schema/myschema1_xsdconfig"
            tofile="${project}/src/my/schema/myschema.xsdconfig"
            overwrite="true"/>
        <xmlbean
            classpathref="compile-path"
            srcgendir="${project}/generated"    
            classgendir="${project}/bin"
            schema="${project}/src/my/schema/"/>
    </target>

</project>


any ideas ?

jc

PS: I do have the eclipse workspace if someone want to try it out too !












- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/