You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Angeshwar Deepak <an...@yahoo.com> on 2004/07/24 11:16:06 UTC

Using tidy.jar in Java task-problem

Hi,

I have to use the tidy.jar to make the html files in a
directory - as well formed.

I tried it with ant java task.

<java classname="org.w3c.tidy.Tidy" output="f:\test\"
fork="true">
<arg line="-f C:\june18\errs.txt -asxhtml -numeric
f:\test\ &gt;&gt; f:\test\output1.txt"/>
</java>

It works fine.

But how can I make this to work for an entire set of
directory. I understood that ant java task takes
argument and so it takes only 1 file.

for example, i have a directory structure

c:\w\x\y\z\

I have some html files in each subdirectory. I want
the these files to be tidy up using ant java task and
placed in another directory as

d:\w\x\y\z\

i.e. I want the diretory structure to be the same with
the html files made well formed and the extension
changed as .ehtml

How can this be done. i.e. how can I add srcdir,
destdir, includes, excludes etc attributes to ant java
task?

bye,
with regards,
Deepak.

=====
-----------------------------------------------
 
Deepak Angeswar, 

Home: 
Pfaffenwaldring 48 C / 202, 
70569 Stuttgart, Germany. 
Ph: 
Home: 049-0711-1225292 
Mobile: 049-0176-24039227 

Office: 
Work Student- 
DaimlerChrysler AG 
ITI/TP, 
Building R+V Geb�ude, 
Eichwiesenring 14, 
70567 Stuttgart, Germany. 
Email Id: deepak.angeswar@daimlerchrysler.com



		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Using tidy.jar in Java task-problem

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Deepak,
> Hi,
> 
> I have solved the problem by using a foreach task. So
> everythings fine now. My next task is to rename all
> the files that I have made tidy. I have to rename all
> the files from .html to .ehtml so that it can be added
> to forrest tool for building the project site.
> 
use the move task with a nested mapper. Have a look at the documentation.
This should be an easy one.
Cheers,
Antoine


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Using tidy.jar in Java task-problem

Posted by Angeshwar Deepak <an...@yahoo.com>.
Hi,

I have solved the problem by using a foreach task. So
everythings fine now. My next task is to rename all
the files that I have made tidy. I have to rename all
the files from .html to .ehtml so that it can be added
to forrest tool for building the project site.

I came across a previous message where the user
suggested to make use of 

<ant:fileScanner var="plugins">
.....
.....
</ant:fileScanner>

But I think there should be some easier method. I
suppose that the tidy tool itself must be having some
option to change the extension of files from .html to
.xml or .xhtml etc.

So I am still searching for some Idea.
Someone who has some idea-please suggest me some
solution.

bye,
with regards,
Deepak.

--- Antoine Levy-Lambert <an...@gmx.de> wrote:
> Hello,
> look at ant-contrib
> http://ant-contrib.sourceforge.net/
> in ant-contrib, there are for and foreach tasks that
> you can use to iterate
> over a set of files.
> Cheers,
> Antoine
> > Hi,
> > 
> > I have to use the tidy.jar to make the html files
> in a
> > directory - as well formed.
> > 
> > I tried it with ant java task.
> > 
> > <java classname="org.w3c.tidy.Tidy"
> output="f:\test\"
> > fork="true">
> > <arg line="-f C:\june18\errs.txt -asxhtml -numeric
> > f:\test\ &gt;&gt; f:\test\output1.txt"/>
> > </java>
> > 
> > It works fine.
> > 
> > But how can I make this to work for an entire set
> of
> > directory. I understood that ant java task takes
> > argument and so it takes only 1 file.
> > 
> > for example, i have a directory structure
> > 
> > c:\w\x\y\z\
> > 
> > I have some html files in each subdirectory. I
> want
> > the these files to be tidy up using ant java task
> and
> > placed in another directory as
> > 
> > d:\w\x\y\z\
> > 
> > i.e. I want the diretory structure to be the same
> with
> > the html files made well formed and the extension
> > changed as .ehtml
> > 
> > How can this be done. i.e. how can I add srcdir,
> > destdir, includes, excludes etc attributes to ant
> java
> > task?
> > 
> > bye,
> > with regards,
> > Deepak.
> > 
> > =====
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Using tidy.jar in Java task-problem

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello,
look at ant-contrib http://ant-contrib.sourceforge.net/
in ant-contrib, there are for and foreach tasks that you can use to iterate
over a set of files.
Cheers,
Antoine
> Hi,
> 
> I have to use the tidy.jar to make the html files in a
> directory - as well formed.
> 
> I tried it with ant java task.
> 
> <java classname="org.w3c.tidy.Tidy" output="f:\test\"
> fork="true">
> <arg line="-f C:\june18\errs.txt -asxhtml -numeric
> f:\test\ &gt;&gt; f:\test\output1.txt"/>
> </java>
> 
> It works fine.
> 
> But how can I make this to work for an entire set of
> directory. I understood that ant java task takes
> argument and so it takes only 1 file.
> 
> for example, i have a directory structure
> 
> c:\w\x\y\z\
> 
> I have some html files in each subdirectory. I want
> the these files to be tidy up using ant java task and
> placed in another directory as
> 
> d:\w\x\y\z\
> 
> i.e. I want the diretory structure to be the same with
> the html files made well formed and the extension
> changed as .ehtml
> 
> How can this be done. i.e. how can I add srcdir,
> destdir, includes, excludes etc attributes to ant java
> task?
> 
> bye,
> with regards,
> Deepak.
> 
> =====


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org