You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jerome Paul <je...@ephox.com> on 2003/01/07 02:42:51 UTC

Basedir not working

Hi,
  I'm using xml files that make use of includes and I want to use the style
task to convert these xml documents to html.  In order for the entities to
be found by ant I have to use absolute pathnames or really cumbersome
relative paths.  

  My latest attempt is to have a build file for each root xml document in
the same folder (along with the xml files to be included).  I then call
these build files as sub projects of my main build file and specify the
folder that contains the build file and the xml documents as the base
directory.  The files don't get found when I run the build files as sub
projects but these same build files when run from the command prompt do
work... 

 I've tried using xml catalogs to resolve the entities by specifing the
absolute path and no fatal errors occur when I did this but the entities
werenot included in translated document.  (xml catalogs arn't what I want to
use anyway).  I've also tried specifying the basedir attribute of the style
task and this doesn't work either.  

I've attached an example of code I'm using

    <target name="HTML" depends="init">
        <echo message="Converting xml documents into html"/>
        <ant 
            antfile="htmlbuild.xml" 
            dir="${xml-files}documents"/>
        <ant
            antfile="htmlBuild.xml"
            dir="${xml-files}project/requirements"/>
    </target>
Does anyone know how to force ant to use look in the same directory as the
xml document of entities without having to specify absolute paths or paths
relative to the main build file?

Cheers
Jerome Paul

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basedir not working

Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
I have tried to reproduce your problem and I did not encounter it.
I have done that with a build done with recent CVS sources.

You might want to do ant -debug or ant -verbose to see more of what your
build files are doing.
Also display the basedir property with
       <echo>
          basedir=${basedir}
       </echo>
to see if it is setup OK in your subprojects.


project :
---------
<project name="myproj" default="default">
    <target name="default">
    <ant dir="subtmp" antfile="subbuild.xml">
    </ant>
    </target>
</project>
subproject :
------------
<project name="subtmp" default="subdef">
   <target name="subdef">
       <echo>
          basedir=${basedir}
       </echo>
       <style style="OrgChart.xsl" basedir="." destdir="."
includes="OrgChart.xml">

       </style>
   </target>
</project>

This works for me.
If I put my main project under /tmp and the subproject in /tmp/subtmp, the
<echo> task says :
/tmp/subtmp which is what one wants, and the style task finds the files
OrgChart.xsl and OrgChart.xml located
under /tmp/subtmp


----- Original Message -----
From: "Jerome Paul" <je...@ephox.com>
To: "'Ant Users List'" <an...@jakarta.apache.org>
Sent: Tuesday, January 07, 2003 2:42 AM
Subject: Basedir not working


> Hi,
>   I'm using xml files that make use of includes and I want to use the
style
> task to convert these xml documents to html.  In order for the entities to
> be found by ant I have to use absolute pathnames or really cumbersome
> relative paths.
>
>   My latest attempt is to have a build file for each root xml document in
> the same folder (along with the xml files to be included).  I then call
> these build files as sub projects of my main build file and specify the
> folder that contains the build file and the xml documents as the base
> directory.  The files don't get found when I run the build files as sub
> projects but these same build files when run from the command prompt do
> work...
>
>  I've tried using xml catalogs to resolve the entities by specifing the
> absolute path and no fatal errors occur when I did this but the entities
> werenot included in translated document.  (xml catalogs arn't what I want
to
> use anyway).  I've also tried specifying the basedir attribute of the
style
> task and this doesn't work either.
>
> I've attached an example of code I'm using
>
>     <target name="HTML" depends="init">
>         <echo message="Converting xml documents into html"/>
>         <ant
>             antfile="htmlbuild.xml"
>             dir="${xml-files}documents"/>
>         <ant
>             antfile="htmlBuild.xml"
>             dir="${xml-files}project/requirements"/>
>     </target>
> Does anyone know how to force ant to use look in the same directory as the
> xml document of entities without having to specify absolute paths or paths
> relative to the main build file?
>
> Cheers
> Jerome Paul
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Basedir not working

Posted by Dale Anson <da...@germane-software.com>.
Could it be that you need a path separator after ${xml-files}?

    <target name="HTML" depends="init">
        <echo message="Converting xml documents into html"/>
        <ant 
            antfile="htmlbuild.xml" 
            dir="${xml-files}/documents"/>
        <ant
            antfile="htmlBuild.xml"
            dir="${xml-files}/project/requirements"/>
    </target>



Jerome Paul wrote:

>Hi,
>  I'm using xml files that make use of includes and I want to use the style
>task to convert these xml documents to html.  In order for the entities to
>be found by ant I have to use absolute pathnames or really cumbersome
>relative paths.  
>
>  My latest attempt is to have a build file for each root xml document in
>the same folder (along with the xml files to be included).  I then call
>these build files as sub projects of my main build file and specify the
>folder that contains the build file and the xml documents as the base
>directory.  The files don't get found when I run the build files as sub
>projects but these same build files when run from the command prompt do
>work... 
>
> I've tried using xml catalogs to resolve the entities by specifing the
>absolute path and no fatal errors occur when I did this but the entities
>werenot included in translated document.  (xml catalogs arn't what I want to
>use anyway).  I've also tried specifying the basedir attribute of the style
>task and this doesn't work either.  
>
>I've attached an example of code I'm using
>
>    <target name="HTML" depends="init">
>        <echo message="Converting xml documents into html"/>
>        <ant 
>            antfile="htmlbuild.xml" 
>            dir="${xml-files}documents"/>
>        <ant
>            antfile="htmlBuild.xml"
>            dir="${xml-files}project/requirements"/>
>    </target>
>Does anyone know how to force ant to use look in the same directory as the
>xml document of entities without having to specify absolute paths or paths
>relative to the main build file?
>
>Cheers
>Jerome Paul
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>