ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: FW: Retrieve all the nodes in an XML file using xmlproperty
Date Mon, 12 May 2003 14:41:48 GMT
I was afraid you may say this.... ;-)
The .java is added to the end of the property value of
"${suite.testcases.filename}" not to each of the components
of the string.

You will need to do something like xsl to convert
the input xml.

something like:

<suite xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:for-each select="suite/testcases">
    <testfile><xsl:value-of select="@filename"/>.java</testfile>
  </xsl:for-each>
</suite>

and the target:
  <target name="t">
    <delete quiet="yes" dir="classes"/>
    <mkdir dir="classes"/>
    <style in="x.xml" out="converted.xml" style="style.xml"/>
    <xmlproperty file="converted.xml"/>
 
    <echo>${suite.testfile}</echo>
    <javac srcdir="src" destdir="classes" 
           includes="${suite.testfile}"/>
  </target>


Peter.

On Monday 12 May 2003 13:51, Dharnidhar Vemuri wrote:
> Thanks Peter. It worked this time. The XML file that I get is from a
> polling event.
> so I cannot change the xml format to the format mentioned by you.
>
> Suggested XML change by You
> <suite filename='MyApplicationTestSet'>
>     <testcases filename='MyModule.java'>
>         <testcase name='testMyMethod'/>
>     </testcases>
>     <testcases filename='MyModule1.java'>
>         <testcase name='testMyMethod'/>
>     </testcases>
> </suite>
>
> Actual XML that I receive from a polling event
> <suite filename='MyApplicationTestSet'>
>     <testcases filename='MyModule'>
>         <testcase name='testMyMethod'/>
>     </testcases>
>     <testcases filename='MyModule1'>
>         <testcase name='testMyMethod'/>
>     </testcases>
> </suite>
>
> I tried to change the build file from
>
> Target that you have suggested
>
>     <echo>${suite.testcases.filename}</echo>
>     <javac srcdir="src" destdir="classes"
>            includes="${suite.testcases.filename}"/>
>
>
> Target that I have
>
>     <echo>${suite.testcases.filename}.java</echo>
>     <javac srcdir="src" destdir="classes"
>            includes="${suite.testcases.filename}.java"/>
>
> echo results in  [echo] MyModule, MyModule1.java
>
> It does not echo MyModule.java but instead echoes MyModule. As a result
> this is not compiled. Why does it not appened .java to all.
>
> Dhar
>


Mime
View raw message