[Xmltask-users] FW: concat properties (or variable)
Brought to you by:
bagnew
From: <hin...@ac...> - 2005-07-04 13:42:54
|
-----Original Message----- From: Lwahhabi, Hind Sent: Mon 7/4/2005 3:24 PM To: Brian Agnew Subject: concat properties (or variable) =20 Hello guys ! i wanted to know is somebody already came across the following: i 'am using the task <call> from xml task. I want to concat in a = variable(from ant-contrib) all the values of a special attribute taken = from my xml input file. i.e <foos> <foo name=3D"blabla1"/> <foo name=3D"blabla2"/> <foo name=3D"blabla3"/> <foo name=3D"blabla4"/> <foo name=3D"blabla5"/> </foos> I want to store all the names in a variable allNames so that: allNames=3D" blabla1, blabla2, blabla3, blabla4, blabla5". any clue? thanks in advance. -----Original Message----- From: xml...@li... on behalf of Brian Agnew Sent: Fri 7/1/2005 3:45 PM To: Maarten Coene Cc: xml...@li... Subject: Re: [Xmltask-users] problems using <call> and buffer =20 Hi, I can't replicate this :-( Can you let me have the complete xml doc=20 you're matching against ? ant/dependencies.xml Maarten Coene wrote: > Hi, > =20 > I'm receiving a NPE if I use the <call> element together with a = buffer. > For instance, I have the following targets: > =20 > <target name=3D"a"> > <xmltask source=3D"ant/dependencies.xml"> > <print path=3D"/dependencies/dependency[2]" = comment=3D"XPath=20 > result"/> > <call path=3D"/dependencies/dependency[2]"=20 > buffer=3D"dependencyBuf" target=3D"b" /> > </xmltask> > </target> > =20 > <target name=3D"b"> > <xmltask sourcebuffer=3D"dependencyBuf"> > <print buffer=3D"dependencyBuf" comment=3D"Contents of=20 > dependencyBuf"/> > </xmltask> > </target> > I'm using Ant 1.6.3 and JDK 1.4. > =20 > If I execute "ant a -verbose", I receive the following = exception/output: > =20 > >>> console output: > a: > [xmltask] Reading ant/dependencies.xml > [xmltask] Executing xmltask 1.11 > [xmltask] Processing ant/dependencies.xml [no output document] > [xmltask] Using predefined xml catalog > [xmltask] Applying com.oopsconsultancy.xmltask.PrintAction@497934=20 > <mailto:com.oopsconsultancy.xmltask.PrintAction@497934> to /dependen > cies/dependency[2] > [xmltask] { node output - XPath result > [xmltask] <dependency> > [xmltask] <groupId>junit</groupId> > [xmltask] <artifactId>junit</artifactId> > [xmltask] <version>3.8.1</version> > [xmltask] <type>jar</type> > [xmltask] <scope>test</scope> > [xmltask] </dependency> > [xmltask] } node output > [xmltask] Applied com.oopsconsultancy.xmltask.PrintAction@497934=20 > <mailto:com.oopsconsultancy.xmltask.PrintAction@497934> - 1 match(es) > [xmltask] Applying CallAction(b) to /dependencies/dependency[2] > [xmltask] Calling target b for [dependency: null] (in buffer=20 > dependencyBuf > [xmltask] Storing [dependency: null] against buffer (dependencyBuf) > [...] > > b: > [xmltask] Executing xmltask 1.11 > [xmltask] Processing dependencyBuf [no output document] > [xmltask] Applying com.oopsconsultancy.xmltask.PrintAction@d73c7a=20 > <mailto:com.oopsconsultancy.xmltask.PrintAction@d73c7a> > [xmltask] Couldn't find any entries for buffer 'dependencyBuf' > [xmltask] Applied com.oopsconsultancy.xmltask.PrintAction@d73c7a=20 > <mailto:com.oopsconsultancy.xmltask.PrintAction@d73c7a> > [xmltask] java.lang.NullPointerException > [xmltask] at=20 > com.oopsconsultancy.xmltask.XmlReplacement.apply(XmlReplaceme > nt.java:65) > [xmltask] at=20 > com.oopsconsultancy.xmltask.ant.XmlTask.processDoc(XmlTask.ja > va:674) > [xmltask] at=20 > com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java: > 643) > [xmltask] at=20 > org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja > va:275) > [xmltask] at org.apache.tools.ant.Task.perform(Task.java:364) > [xmltask] at = org.apache.tools.ant.Target.execute(Target.java:341) > [xmltask] at=20 > org.apache.tools.ant.Target.performTasks(Target.java:369) > [xmltask] at=20 > org.apache.tools.ant.Project.executeSortedTargets(Project.jav > a:1216) > [xmltask] at=20 > org.apache.tools.ant.helper.SingleCheckExecutor.executeTarget > s(SingleCheckExecutor.java:37) > [xmltask] at=20 > org.apache.tools.ant.Project.executeTargets(Project.java:1068 > ) > [xmltask] at = org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) > [xmltask] at=20 > com.oopsconsultancy.xmltask.CallAction.apply(CallAction.java: > 129) > [xmltask] at=20 > com.oopsconsultancy.xmltask.XmlReplace.apply(XmlReplace.java: > 73) > [xmltask] at=20 > com.oopsconsultancy.xmltask.XmlReplacement.apply(XmlReplaceme > nt.java:60) > [xmltask] at=20 > com.oopsconsultancy.xmltask.ant.XmlTask.processDoc(XmlTask.ja > va:674) > [xmltask] at=20 > com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java: > 643) > [xmltask] at=20 > org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja > va:275) > [xmltask] at org.apache.tools.ant.Task.perform(Task.java:364) > [xmltask] at = org.apache.tools.ant.Target.execute(Target.java:341) > [xmltask] at=20 > org.apache.tools.ant.Target.performTasks(Target.java:369) > [xmltask] at=20 > org.apache.tools.ant.Project.executeSortedTargets(Project.jav > a:1216) > [xmltask] at=20 > org.apache.tools.ant.Project.executeTarget(Project.java:1185) > [xmltask] at=20 > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De > faultExecutor.java:40) > [xmltask] at=20 > org.apache.tools.ant.Project.executeTargets(Project.java:1068 > ) > [xmltask] at org.apache.tools.ant.Main.runBuild(Main.java:668) > [xmltask] at org.apache.tools.ant.Main.startAnt(Main.java:187) > [xmltask] at=20 > org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) > [xmltask] at=20 > org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) > [xmltask] Exiting ant\build.xml. > [xmltask] Applied CallAction(b) - 1 match(es) > > = ------------------------------------------------------------------------ > Yahoo! Sports > Rekindle the Rivalries. Sign up for Fantasy Football=20 > = <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=3D33539/*http://football= .fantasysports.yahoo.com?ovchn=3DYAH&ovcpn=3DIntegration&ovcrn=3DMail+foo= ter&ovrfd=3DYAH&ovtac=3DAD%20>=20 --=20 Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd brian @ oopsconsultancy.com Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 This message is for the designated recipient only and may contain = privileged, proprietary, or otherwise private information. If you have = received it in error, please notify the sender immediately and delete = the original. Any other use of the email by you is prohibited. |