Problem running junitreport ant task

Help
2004-10-12
2012-10-08
  • Mike Hedman
    Mike Hedman
    2004-10-12

    Hello,

    <<first off, sorry for posting this in the bug system first, I had intended to post on the forum>>

    I have an ant file that runs a bunch of JUnit tests,
    then uses the junitreport task to transform the test results into an HTML report.

    This task fails if I have Saxon on my classpath (and works fine if I remove Saxon from the classpath).

    I'm using 8.1.1. (it also failed with 8.1)

    The ant task is using Xalan Java 2.4.1.

    Here's a copy of the error message:
    Error at (anonymous type) on line 48 of
    file:///C:/ngp_tools/apache-ant-1.6.1/etc/junit-frames.xsl:

    javax.xml.transform.TransformerConfigurationException:
    Unknown extension element

    Here's line 48 of the file it's trying to transform:
    <xsl:template match="testsuites">

    I have confidence that there's nothing wrong with the xsl file, as I've used it for quite a while without any previous problems.

    Any ideas would be appreciated.
    Thanks,
    Mike

     
    • Michael Kay
      Michael Kay
      2004-10-13

      I think I need to see a more complete stylesheet to help you diagnose this error.

      Michael Kay

       
      • Mike Hedman
        Mike Hedman
        2004-10-13

        Michael,

        Thanks for your reply (and for your book!).

        The specific file that it's failing on is (and I'm hoping you have ant installed):
        ...\apache-ant-1.6.1\etc\junit-frames.xsl

        I'm of the opinion that this is a classpath/version problem rather than an issue with saxon not being able to sort through this one xsl file. Ant, by default, uses Xalan, and I'm wondering if java is getting confused when it also finds Saxon on the classpath.

        If it would be helpful, I can work up a small ant script that would illustrate the problem.

        Mike

         
        • Michael Kay
          Michael Kay
          2004-10-14

          This stylesheet is full of Xalan-specific extensions such as:

          &lt;redirect:write file=&quot;{$output.dir}/index.html&quot;&gt;
              &lt;xsl:call-template name=&quot;index.html&quot;/&gt;
          &lt;/redirect:write&gt;
          

          You need to configure Ant, or arrange the classpath, so that Xalan is used to process this stylesheet.

          Michael Kay

           
          • Mike Hedman
            Mike Hedman
            2004-10-15

            Michael,

            Thanks for your replies. I got around this by removing Saxon from my system classpath. I'm doing my development in XMLSpy, so I just hardcode the path to Saxon in XMLSpy there so that there is no classpath dependency.

            Mike