Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 14251 invoked by uid 500); 20 Jun 2001 17:12:57 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 13895 invoked from network); 20 Jun 2001 17:12:41 -0000 Message-ID: <83EC13A1D65CD4118225001083FD7A034013EF@sf03mail1.escore.com> From: Lorenzo Rodriguez To: "'ant-user@jakarta.apache.org'" Subject: RE: How do I capture the current directory during execution? Date: Wed, 20 Jun 2001 10:08:11 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C0F9AB.95B33F10" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0F9AB.95B33F10 Content-Type: text/plain; charset="ISO-8859-1" Thanks a lot Brett! works! '${root}' gets evaluated to the appropriate value and passed to the stylesheet just fine. But that is not quite what I need. Here is the directory structure of the input data: ${root}/dir1 ${root}/dir2 ${root}/dir3 etc. The includes="**/*.ent" will match dir1/file1.ent dir2/file1.ent dir2/file2.ent dir3/file1.ent etc. What I need is to pass dir1 (or ${root}/dir1), dir2, dir2, dir3 depending on what file is being processed. Ideally, this would be a variable that is set every time Ant evaluates the includes="**/*.ent" statement. But I'm not even sure that's possible in Ant. I would think Ant has a mechanism for doing that, since it seems useful for logging purposes and/or displaying such information to the standard output. --Lorenzo -----Original Message----- From: Brett Knights [mailto:brett@knightsofthenet.com] Sent: Tuesday, June 19, 2001 8:03 PM To: ant-user@jakarta.apache.org Subject: RE: How do I capture the current directory during execution? If it is supposed to be an XPATH then try The '' will have the expression interpreted as a string. As mentioned Saxon has an extension function that returns the path of the current document. It has functionality equivalent to Xalan's redirect. I'm not sure how xalan works but what happens when you test a relative path as the destination for one of your files? If that saves to relative paths wouldn't that work in conjunction with the destdir parameter? HTH -----Original Message----- From: Lorenzo Rodriguez [mailto:Lorenzo_Rodriguez@eSCORE.com] Sent: Tuesday, June 19, 2001 6:04 PM To: 'ant-user@jakarta.apache.org' Subject: RE: How do I capture the current directory during execution? 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 as follows 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: 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 ------_=_NextPart_001_01C0F9AB.95B33F10 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable RE: How do I capture the current directory during = execution?

Thanks a lot Brett!

<param name=3D"workDir" = expression=3D"'${root}'"/> works!

'${root}' gets evaluated to the appropriate value and = passed to the stylesheet just fine.  But that is not quite what I = need.  Here is the directory structure of the input = data:

${root}/dir1

${root}/dir2

${root}/dir3

etc.

The includes=3D"**/*.ent" will match =
dir1/file1.ent
dir2/file1.ent
dir2/file2.ent
dir3/file1.ent
etc.

What I need is to pass dir1 (or ${root}/dir1), dir2, = dir2, dir3 depending on what file is being processed.  Ideally, = this would be a variable that is set every time Ant evaluates the = includes=3D"**/*.ent" statement.  But I'm not even sure = that's possible in Ant.  I would think Ant has a mechanism for = doing that, since it seems useful for logging purposes and/or = displaying such information to the standard output.

--Lorenzo


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


If it is supposed to be an XPATH then try
<param name=3D"workDir" = expression=3D"'${root}'"/>
The '' will have the expression interpreted as a = string.

As mentioned Saxon has an extension function that = returns the path of the current document. It has functionality = equivalent to

Xalan's redirect.

I'm not sure how xalan works but what happens when = you test a relative path as the destination for one of your files? If = that saves

to relative paths wouldn't that work in conjunction = with the destdir parameter?

HTH

-----Original Message-----
From: Lorenzo Rodriguez [mailto:Lorenzo_Rodriguez@eS= CORE.com]
Sent: Tuesday, June 19, 2001 6:04 PM
To: 'ant-user@jakarta.apache.org'
Subject: RE: How do I capture the current directory = during execution?
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=3D"..\..\adwe\rt\apache\conf\httpd.conf"  = token=3D"C:/adwe"
value=3D"${server.root}/>
<replace = file=3D"..\..\adwe\rt\tomcat\conf\mod_jk.conf" = token=3D"C:/adwe"
value=3D"${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.c= om]
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=3D"workDir" = expression=3D"${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@eS= CORE.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=3D"publishItems" = depends=3D"init, prepare">
        <style = basedir=3D"${root}"
          &nb= sp;     = destdir=3D"${buildroot}/itemXML"
          &nb= sp;     = style=3D"../bin/xslt/sgml.xsl"
          &nb= sp;     includes=3D"**/*.ent"
          &nb= sp;     extension=3D".xml"
          &nb= sp;     processor=3D"xalan">
          &nb= sp; <!-- param name=3D"workDir" expression=3D""/ = -->
        = </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

------_=_NextPart_001_01C0F9AB.95B33F10--