You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Dharnidhar Vemuri <dv...@arsin.com> on 2003/05/12 13:12:34 UTC

FW: Retrieve all the nodes in an XML file using xmlproperty

> Hi,
> 
> I have an xml file with the following structure:
> 
> <suite filename='MyApplicationTestSet'>
>     <testcases filename='MyModule'>
>         <testcase name='testMyMethod'/>
>     </testcases>
>     <testcases filename='MyModule1'>
>         <testcase name='testMyMethod'/>
>     </testcases>
> </suite>
> 
> 
> What I am interested is to retrieve all the testcase filenames append
> '.java' at the end and compile these java files by using javac. 
> 
> My ant target looks like this:
> 
> 
> <target name="compile" depends="init">
>   <xmlproperty file="${xmlfile}" collapseAttributes="true"/>
> 
>   <javac srcdir="${src.dir}" destdir="${cls.dir}" >
>     	 <include name="${suite.testcases.filename}.java"/> 
>   </javac>
> </target>
> 
> When i compile, it compiles only the first file (MyModule.java), but does
> not compile (MyModule1.java). 
> 
> Is there a way by which I can achieve this?
> 
> 
> Thanks in advance,
> Dharnidhar
> 

Re: FW: Retrieve all the nodes in an XML file using xmlproperty

Posted by peter reilly <pe...@corvil.com>.
You would probally change the input to include the .java
in the filename. and use the "includes" attribute of
javac and not the include sub-element.

<suite filename='MyApplicationTestSet'>
     <testcases filename='MyModule.java'>
         <testcase name='testMyMethod'/>
     </testcases>
     <testcases filename='MyModule1.java'>
         <testcase name='testMyMethod'/>
     </testcases>
</suite>

<javac srcdir="${src.dir}" destdir="${cls.dir}" 
           includes="${suite.testcases.filename}"/>

>
On Monday 12 May 2003 12:12, Dharnidhar Vemuri wrote:
> > Hi,
> >
> > I have an xml file with the following structure:
> >
> > <suite filename='MyApplicationTestSet'>
> >     <testcases filename='MyModule'>
> >         <testcase name='testMyMethod'/>
> >     </testcases>
> >     <testcases filename='MyModule1'>
> >         <testcase name='testMyMethod'/>
> >     </testcases>
> > </suite>
> >
> >
> > What I am interested is to retrieve all the testcase filenames append
> > '.java' at the end and compile these java files by using javac.
> >
> > My ant target looks like this:
> >
> >
> > <target name="compile" depends="init">
> >   <xmlproperty file="${xmlfile}" collapseAttributes="true"/>
> >
> >   <javac srcdir="${src.dir}" destdir="${cls.dir}" >
> >     	 <include name="${suite.testcases.filename}.java"/>
> >   </javac>
> > </target>
> >
> > When i compile, it compiles only the first file (MyModule.java), but does
> > not compile (MyModule1.java).
> >
> > Is there a way by which I can achieve this?
> >
> >
> > Thanks in advance,
> > Dharnidhar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org