ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "W. Sean Hennessy" <shenne...@goldenhourdata.com>
Subject RE: Problem-using foreach + tidy.jar
Date Tue, 27 Jul 2004 16:04:41 GMT
<!-- JTidy properties -->
   <property name="tidy.err.file.spec" value="${out.dir}${file.separator}jtidy-build.log"/>
   <property name="tidy.conf.file" value="${docbookHome}${file.separator}sorted-tidy-conf.txt"/>
   <property name="jtidy.version" value="04aug2000r6"></property>
   <property name="jtidy.dir" value="${tools.dir}${file.separator}jtidy-${jtidy.version}">
</property>
   <property name="jtidy.jar" value="${jtidy.dir}${file.separator}build${file.separator}Tidy.jar"></property>
   <property name="tidy.processor.class" value="org.w3c.tidy.Tidy" />
   <path id="tidy.processor.classpath">
      <pathelement path="${jtidy.jar}" />
      <pathelement path="."/>
   </path>

     <target name="tidy-html">
        <java classname="${tidy.processor.class}" 
	       fork="yes" 
	       dir="${in.dir}"
	       failonerror="false">
	       <classpath refid="tidy.processor.classpath" />
	       <arg line="-c ${tidy.conf.file} -f ${tidy.err.file.spec}" />
	       <arg line="-raw"/>
           <arg line="-modify"/>
           <arg line="-indent"/>
           <arg line="${out.dir}/${main.outfile}"/>
          
        </java>
     </target>

-----Original Message-----
From: Angeshwar Deepak [mailto:angeshwar@yahoo.com] 
Sent: Tuesday, July 27, 2004 12:50 AM
To: user@ant.apache.org
Subject: Problem-using foreach + tidy.jar


Hi,

I have used a foreach to iterate a directory to search
for html files and tidy them.

The code is as follows

......
......
<foreach param="msg" target="run_tidy">
        <path>       
            <fileset dir="${build.test.report.html}/${component}">
                <include name="**/*.html"/> 
            </fileset>
		</path>
		</foreach>
</target>

<target name="run_tidy">    
    <echo>
    ********* ${msg}
    </echo>
	<java classname="org.w3c.tidy.Tidy" fork="true" >
		<arg line="-config c:\tidy-config.txt -f errs.txt
-asxhtml -numeric ${msg} " />
	</java>

</target>

It works perfectly fine.
Except for the fact that I cant specify a relative
path for the file tidy-config.txt. i.e. I dont want to
specify the file as c:\tidy-config.txt. But insted as 
${tidy} or so.

I saw an example as follows in the ant webpage

<property name="browser"
location="C:/Programme/Internet
Explorer/iexplore.exe"/>
<property name="file"
location="ant/docs/manual/index.html"/>

<exec executable="${browser}" spawn="true">
    <arg value="${file}"/>
</exec>

But this does'nt work for my piece of code.
Please suggest some solution to avoid writing the 
absolute or real path for the file.

bye,
with regards,
Deepak.



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages! 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





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


Mime
View raw message