参考文档地址:http://blog.csdn.net/ccjjyy/article/details/6309074

我修改后的 xml 如下:

<project name= "testNG_test" basedir= "." >

    <property name= "lib.dir" value= "lib" />

    <path id= ".classpath" >

         <!-- adding the saxon jar to your classpath -->

        <fileset dir= "${lib.dir}" includes= "*.jar" />

    </path>

    <target name= "transform" >

        <xslt in= "E:\Users\Administrator\workspace\testNG_test\test-output\testng-results.xml" style= "E:\Users\Administrator\workspace\testNG_test\test-output\testng-results.xsl"

  out= "E:\Users\Administrator\workspace\testNG_test\test-output\index1.html " >

             <!-- you need to specify the directory here again -->

            <param name= "testNgXslt.outputDir" expression= "E:\Users\Administrator\workspace\testNG_test\test-output\" />

            <classpath refid= ".classpath" />

        </xslt>

    </target>

</project>

我修改了 project 名字和对应的路径
saxon-8.7.jar 也放到了 lib 目录下
testng-results.xsl 也放到 test-output 目录下
然后执行 ant 的时候只有如下提示,没有生成 index1.html

E:\Users\Administrator\workspace\testNG_test>ant
Buildfile: E:\Users\Administrator\workspace\testNG_test\build.xml

BUILD SUCCESSFUL
Total time: 0 seconds

这到底是为什么,本地路径两个斜杠都试过了,还是一样的效果,是我的 xml 哪里没有修改对么?请大神们帮忙看看


↙↙↙阅读原文可查看相关链接,并与作者交流