ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject RE: Modify all files of a certain name in a tree with dirs determined by patterns, using xslt
Date Tue, 24 May 2005 21:55:00 GMT
I've managed to resolve some of this.  Someone on the xalan-j list
pointed out the "xmlcatalog" element, which I had noticed in the manual,
but didn't realize what it was for.  This resolves the problem of
accessing the DTD.

My next problem is excluding some specific directories and files.  It
looks like the pattern specs I can use aren't as flexible as I need.
For instance, what I'd like to specify is an "includes" value of:


But an "excludes" value of:


So it would process all the directories specified by the "includes"
pattern, but exclude the ones specified by "Foo*" in the second pattern.
Unfortunately, the Ant file pattern spec doesn't allow anything like

Is there some other way to do this?

The other problem that I'll have to solve is that I have to store the
result of these transformations into a different directory, and then
copy them over the original files.  I tried setting my "destdir" to "."
to cause them to write to the source files, but that broke, not
surprisingly.  I haven't looked much into this yet, but I think it might
be straightforward (steps to copy the files, that is).

> -----Original Message-----
> From: Karr, David 
> Sent: Tuesday, May 24, 2005 12:07 PM
> To: Ant Users List
> Subject: Modify all files of a certain name in a tree with 
> dirs determined by patterns, using xslt
> The subject is a generic statement of what I need.  I'll be a 
> little more specific in here, but focusing on the generic 
> problem may be more helpful.
> I have an exploded ear, and in a bunch of EJB modules whose 
> names begin with certain strings, and end with random 
> "don't-care" strings (at least, I don't care what they are), 
> I need to modify the "weblogic-ejb-jar.xml" file to add a 
> particular element at a point in the tree.
> I see two problems with this so far.  First, I can use the 
> "includes" attribute to specify input file paths, but I don't 
> see any way to specify that the output file should be the input file.
> The second problem is really a separate issue, in that the 
> xslt engine tries to read the DTD specified at the URI in the 
> XML file, which it can't get to.  I need to figure out how to 
> convince the XSLT engine not to do that.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message