You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "J. David Beutel" <jd...@getsu.com> on 2007/08/27 22:51:36 UTC

Re: Setting Xalan to junitreport

Has there been any more action on this issue?  I searched for 
junitreport in Bugzilla but didn't find it.  I'm interested in using 
some XSLT 2 for junitreport.  I guess that means Saxon instead of JDK 
1.5's XSLTC.

Cheers,
11011011

Weston, Toby wrote:
> Hi Antoine,
>
> Sounds great, is that the point where its easiest to keep an eye on things -
> when there's a Bugzilla ticket to track?
>
> Thanks,
> Toby 
>
> -----Original Message-----
> From: Antoine Levy-Lambert [mailto:antoine@gmx.de] 
> Sent: 12 June 2006 15:37
> To: Ant Developers List
> Subject: Re: Re: Setting Xalan to junitreport
>
> Hello Toby,
>
> Changing junitreport so that junitreport delegates to the xslt task is still
> on my agenda. Ivan Ivanov is preparing a patch for this which will go first
> in Bugzilla.
>
> Regards,
>
> Antoine
> -------- Original-Nachricht --------
> Datum: Mon, 12 Jun 2006 14:54:10 +0100
> Von: "Weston, Toby" <to...@Misys.com>
> An: dev@ant.apache.org
> Betreff: Re: Setting Xalan to junitreport
>
>   
>> Hi Guys,
>>
>> Sorry, been off list for a while, but does anyone know about any 
>> progress on the following;
>>
>> http://marc.theaimsgroup.com/?l=ant-dev&m=114718268207732&w=2
>>
>> It's regarding Antoine's comments on making junitreport use the xslt 
>> task (and so enable switching of XSLT engines).
>>
>> Thanks in advance,
>> Toby
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional 
>> commands, e-mail: dev-help@ant.apache.org
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional
> commands, e-mail: dev-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>   


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


Re: Setting Xalan to junitreport

Posted by Dominique Devienne <dd...@gmail.com>.
On 8/29/07, J. David Beutel <jd...@getsu.com> wrote:
> I haven't had much luck using XSLT 2 for junitreport.  I think Saxon has
> a problem with the redirect extension, which looks specific to Xalan.

Indeed it is. You'll need to modify the .xsl to use Saxon instead of Xalan.

XSL 2.0 supports <result-document>, the equivalent of Xalan's redirect
but as part of the language itself, not as an extension. Converting a
XSL 1.0 stylesheet into a 2.0 requires a few tweaks usually (but I
don't recall which... It's been a couple years since I did any XSL).
--DD

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


Re: Setting Xalan to junitreport

Posted by "J. David Beutel" <jd...@getsu.com>.
I haven't had much luck using XSLT 2 for junitreport.  I think Saxon has 
a problem with the redirect extension, which looks specific to Xalan.

--- Nested Exception ---
; SystemID: 
file:/c:/safe/projects/travelIdea/travel/work/docs/junit-frames.xsl; 
Line#: 36; Column#: -1
net.sf.saxon.trans.DynamicError: Unknown extension element
        at 
net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:61)

If I pursue this further, I'll probably go the other way, setting the 
timezone in XMLJUnitResultFormatter.

By the way, to get Ant to use Saxon, the xslt task's classpath did not 
work for me, even with the factory element.  It looks like this bug: 
http://issues.apache.org/bugzilla/show_bug.cgi?id=41314

The way I would get Ant to use Saxon now, if I were going to keep 
working on junitreport, is the hack described at the end of that bug:  
setting the system property via SaxonLiaison.  I like that better than 
using the ANT_OPTS environment variable.  Another way I like less is 
adding -lib saxon8.jar to the ant script arguments and a factory element 
to the xslt task.  But the way I like least is Sun's usual endorsed 
standards override mechanism, modifying the JRE (which I didn't even try).

Cheers,
11011011

jcumps@gmail.com wrote:
>
> You could use Ant's JUnitReport task just to create the consolidated 
> xml file (TESTS-TestSuites.xml),
> and then call the XSLT task on that consolidated XML file.
> You can than point the XSLT task's classpath(ref) attribute to your 
> favorite processor.
>
>
>    <junitreport todir="${build.dir}/testreports">
>      <fileset dir="${build.dir}/testresults">
>        <include name="TEST-*.xml"/>
>      </fileset>
> ...
>    </junitreport>
>
>   <xslt classpathref="yourXSLTProcessorref" 
> in="${build.dir}/testresults/TESTS-TestSuites.xml" .....
>
>
> Regards, Jan
>
>
>
>
>
> ----- Original Message ----- From: "J. David Beutel" <jd...@getsu.com>
> To: "Ant Developers List" <de...@ant.apache.org>
> Sent: Tuesday, August 28, 2007 9:44 AM
> Subject: Re: Setting Xalan to junitreport
>
>
>> Stefan Bodewig wrote:
>>> Not using JDK 1.5's XSLTC is a good idea for so many reasons anyway.
>>> You could use the usual endorsed standards override mechanism[1] to
>>> swap in Saxon or just set the system property
>>> javax.xml.transform.TransformerFactory prior to running Ant (you'd
>>> probably use the ANT_OPTS environment variable for this).
>>>
>>
>> Thanks for the advice!
>>
>> I was happy to upgrade to JDK 1.5 and Ant 1.7 because I never liked 
>> copying the Xalan and JUnit JARs into Ant's lib directory.  My 
>> current employer considers Ant, JDK, and Tomcat to be part of the 
>> environment, but has some projects that require them to be 
>> customized.  This complicates working on different projects, so I 
>> look for ways to avoid customizing the environment, keeping the 
>> changes in the version-controlled files.  I guess ANT_OPTS in a 
>> custom script is my best option for XSLT 2.
>>
>> Cheers,
>> 11011011
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>


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


Re: Setting Xalan to junitreport

Posted by jc...@gmail.com.
You could use Ant's JUnitReport task just to create the consolidated xml 
file (TESTS-TestSuites.xml),
and then call the XSLT task on that consolidated XML file.
You can than point the XSLT task's classpath(ref) attribute to your favorite 
processor.


    <junitreport todir="${build.dir}/testreports">
      <fileset dir="${build.dir}/testresults">
        <include name="TEST-*.xml"/>
      </fileset>
...
    </junitreport>

   <xslt classpathref="yourXSLTProcessorref" 
in="${build.dir}/testresults/TESTS-TestSuites.xml" .....


Regards, Jan





----- Original Message ----- 
From: "J. David Beutel" <jd...@getsu.com>
To: "Ant Developers List" <de...@ant.apache.org>
Sent: Tuesday, August 28, 2007 9:44 AM
Subject: Re: Setting Xalan to junitreport


> Stefan Bodewig wrote:
>> Not using JDK 1.5's XSLTC is a good idea for so many reasons anyway.
>> You could use the usual endorsed standards override mechanism[1] to
>> swap in Saxon or just set the system property
>> javax.xml.transform.TransformerFactory prior to running Ant (you'd
>> probably use the ANT_OPTS environment variable for this).
>>
>
> Thanks for the advice!
>
> I was happy to upgrade to JDK 1.5 and Ant 1.7 because I never liked 
> copying the Xalan and JUnit JARs into Ant's lib directory.  My current 
> employer considers Ant, JDK, and Tomcat to be part of the environment, but 
> has some projects that require them to be customized.  This complicates 
> working on different projects, so I look for ways to avoid customizing the 
> environment, keeping the changes in the version-controlled files.  I guess 
> ANT_OPTS in a custom script is my best option for XSLT 2.
>
> Cheers,
> 11011011
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


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


Re: Setting Xalan to junitreport

Posted by "J. David Beutel" <jd...@getsu.com>.
Stefan Bodewig wrote:
> Not using JDK 1.5's XSLTC is a good idea for so many reasons anyway.
> You could use the usual endorsed standards override mechanism[1] to
> swap in Saxon or just set the system property
> javax.xml.transform.TransformerFactory prior to running Ant (you'd
> probably use the ANT_OPTS environment variable for this).
>   

Thanks for the advice!

I was happy to upgrade to JDK 1.5 and Ant 1.7 because I never liked 
copying the Xalan and JUnit JARs into Ant's lib directory.  My current 
employer considers Ant, JDK, and Tomcat to be part of the environment, 
but has some projects that require them to be customized.  This 
complicates working on different projects, so I look for ways to avoid 
customizing the environment, keeping the changes in the 
version-controlled files.  I guess ANT_OPTS in a custom script is my 
best option for XSLT 2.

Cheers,
11011011

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


Re: Setting Xalan to junitreport

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 27 Aug 2007, J. David Beutel <jd...@getsu.com> wrote:

> Has there been any more action on this issue?

Well, yes and no.

<junitreport> delegates to <xslt> under the covers (in 1.7) but you
don't get access to the factory nested element.

> I searched for junitreport in Bugzilla but didn't find it.  I'm
> interested in using some XSLT 2 for junitreport.  I guess that means
> Saxon instead of JDK 1.5's XSLTC.

Not using JDK 1.5's XSLTC is a good idea for so many reasons anyway.

You could use the usual endorsed standards override mechanism[1] to
swap in Saxon or just set the system property
javax.xml.transform.TransformerFactory prior to running Ant (you'd
probably use the ANT_OPTS environment variable for this).

Stefan

[1] http://java.sun.com/j2se/1.4.2/docs/guide/standards/

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