ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Womack <>
Subject RE: DOCTYPE strippper WAS: RE: Filters
Date Tue, 19 Jun 2001 17:38:09 GMT
Greg, I agree that this functionality would be useful.  But I think a
general solution of supporting regular expressions in the replace task would
be better than one specific to DOCTYPE's.  Then you could do just about
anything. (And the commenting the DOCTYPE's out instead of removing is a
better practice.  I think we will adopt it ourselves...)

I dug around in the ant-dev archive, and I found the following message that
has an optional task that performs regular expression replacement.  I'm
surprised that something like this has not already been added into Ant, as
an optional task at least.  I haven't had a chance to try this new task out,
and there is a dependency on the ant oro regular expression package (another
cool Jakarta package).

Thanks to everyone for their help, this is a great list.

-----Original Message-----
From: Greg 'Cosmo' Haun []
Sent: Tuesday, June 19, 2001 10:24 AM
To: ''
Subject: DOCTYPE strippper WAS: RE: Filters

There is a common need, I believe, to strip out DOCTYPES from XML docs.  We
managed with a series of <replace>s  to strip out every permutation of
DOCTYPES we use.  Not terribly efficient.  Do I smell a task brewing? an
option to <copy>?

PS actually we don't strip them, we comment them out.  That way we can
determine type and version by brute force if needed, yet parsers don't choke
for lack of DTD.

Gregory Cosmo Haun
Architect, Interactive Development, Cenquest, Inc.
tele: 503.276.7943    email: ghaun[youknowwhat]

> Check out Cenquest's new Web site at

> -----Original Message-----
> From: Mark Womack []
> Sent: Friday, June 15, 2001 2:14 PM
> To: ''
> Subject: RE: Filters
> Thanks for the reply.  Do you know if the replace task 
> supports something
> like this:
> <replace dir="targetDir" token="&lt;!DOCTYPE**&gt" value="" />
> where '**' is supposed to be a wildcard.  Basically, I want 
> to remove any
> DOCTYPE elements from our pages.
> Thanks,
> -Mark
> -----Original Message-----
> From: Annie Frost []
> Sent: Friday, June 15, 2001 1:15 PM
> To: ''
> Subject: RE: Filters
> You could try using the Replace Task...
> -----Original Message-----
> From: Mark Womack []
> Sent: Friday, June 15, 2001 1:04 PM
> To: ''
> Subject: Filters
> I have a question about filters.  I looked through all the 
> documentation I
> could find before posting here.
> Is it possible to use wild cards or regualr expressions as part of the
> filter token?  What I want to do is remove all occurrences of 
> text from the files that are deployed.  We still want them 
> for development,
> but not for deployment.
> Can I do this?  Or do I have to define a token for every 
> DOCTYPE we use?  Is
> there another Ant mechanism I should be using instead?
> Thanks in advance,
> -Mark
> Supercharge your telephone! -- write your VoiceXML 
> Application for free at
> BeVocal Cafe - Rated #1 VoiceXML development environment and 
> voice hosting
> service by CT Labs!

View raw message