ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lorenzo Rodriguez <Lorenzo_Rodrig...@eSCORE.com>
Subject RE: How do I capture the current directory during execution?
Date Wed, 20 Jun 2001 01:04:16 GMT
Annie,

I have not been able to solve my problem.  And I'm not sure that I can help
you solve yours, but I've seen people create environment.properties files
that specify developer-specific configuration (where they'll run stuff).  I
think Ant can be configured to read those properties files.

Brett,
I thought that expression in param was supposed to be an XPath expression.
In any case, I tried your suggestion and got plenty of XSL and SAX errors.

I'm able to process all my data in the directory structure without passing a
parameter to my stylesheet.  However, I'm using Xalan's redirect extension
and all my data is being placed in one directory.  So I wanted to maintain
the directory structure of my data by passing a directory where I want the
redirect to output data to.

The story gets a bit more complicated because some stylesheets call other
styleshteets that create new files also.  And to make things a bit more
interesting, the output files share IDs and part of their file name.  So,
maintaining the original file structure would make my life a bit easier.

Is there a way in XSLT to find out where the input file is coming from
and/or what's the input's file name?

Thanks for taking some time to read.  I really appreciate it.  
  

--Lorenzo


-----Original Message-----
From: Annie Frost [mailto:AFrost@abilizer.com]
Sent: Tuesday, June 19, 2001 5:44 PM
To: 'ant-user@jakarta.apache.org'
Subject: RE: How do I capture the current directory during execution?


I am working with Apache/Tomcat server configuration which requires the
server root and it cannot be a relative path (for Apache/conf/httpd.conf and
tomcat/conf/mod_jk.conf).

Several Developers in the building will be running Apache/Tomcat on their
machines and I cannot dictate where they are running it.
I am aiming to keep it as light as possible (trying to conform to Windows NT
right now without using any additional shells... pretty much DS bat programs
and ANT only)


I can assume the following:

The build.xml will be located such as 
${server.root}/developer/tools/build.xml

The build.xml will be executed from 
${server.root}/developer/tools.deploy.bat

Apache will be deployed as follows
${server.root}/adwe/rt/apache

Within the build.xml, I have a simple <replace> as follows
<replace file="..\..\adwe\rt\apache\conf\httpd.conf"  token="C:/adwe"
value="${server.root}/>
<replace file="..\..\adwe\rt\tomcat\conf\mod_jk.conf" token="C:/adwe"
value="${server.root}/>

For the most part, the ${server.root} is unnecessary as I can reach
everything through relative paths, but for the Apache set-up, I cannot seem
to pull the ${server.root} as a non-relative path.  Normally, the Apache
install would take care of this, but we have Apache stored in CVS and would
like to dynamically mod these files depending on each developers
environment....  Unless there is a simple solution, I could opt to prompt
each developer to enter the root as necessary each time, but this seems like
an excessive step...

Any hints?



-----Original Message-----
From: Brett Knights [mailto:brett@knightsofthenet.com]
Sent: Tuesday, June 19, 2001 5:25 PM
To: ant-user@jakarta.apache.org
Subject: RE: How do I capture the current directory during execution?


Why can't you just use
<param name="workDir" expression="${root}"/>
or some variation on that theme?

If I may ask why do you need to pass in the directory? I can process
directories with the trax processor (with Saxon behind it)
without any trouble.

FWIW Saxon contains an extension function that will return the system id of
the document being processed. If you really need to use
the location of the document in your stylesheet you might find that a method
in your stylesheet engine will do this for you (as well
as making your stylesheet not dependent on Ant)

-----Original Message-----
From: Annie Frost [mailto:AFrost@abilizer.com]
Sent: Tuesday, June 19, 2001 4:52 PM
To: 'ant-user@jakarta.apache.org'
Subject: RE: How do I capture the current directory during execution?


Lorenzo -

Did you figure this out?  I am having the same problem.  Want to keep it
simple, but am having problems only using ANT.  Seems like
I can only write some other code to read in the directory and pass it...

Thanks,
Annie
-----Original Message-----
From: Lorenzo Rodriguez [mailto:Lorenzo_Rodriguez@eSCORE.com]
Sent: Tuesday, June 19, 2001 10:48 AM
To: 'ant-user@jakarta.apache.org'
Subject: How do I capture the current directory during execution?


How can I process documents in a directory structure, and capture the
directory where the files are being processed from? I need to
pass it to a style sheet.  Here is my code:
<target name="publishItems" depends="init, prepare">
        <style basedir="${root}"
                destdir="${buildroot}/itemXML"
                style="../bin/xslt/sgml.xsl"
                includes="**/*.ent"
                extension=".xml"
                processor="xalan">
            <!-- param name="workDir" expression=""/ -->
        </style>
    </target>
The includes will match **/*.ent, but how can I find out what ** is so that
I can pass that value to sgml.xsl?
Thanks,
--Lorenzo

Mime
View raw message