You can also use <xmltask> and its <insert> command to do the same.
eg. <xmltask source="input.xml" dest="output.xml> <insert path="/web/" file="webinc.xml" position="under"/> </xmltask> or similar, depending on your requirements. More at http://www.oopsconsultancy.com/software/xmltask.html Brian --- Magesh Umasankar <[EMAIL PROTECTED]> wrote: > Typos in both cases: > > Try: > > <target name="merge-descriptor-2"> > <loadfile property="webinc.xml" srcFile="webinc.xml"/> > <copy file="web.xml" toFile="dist/web.xml"> > <filterset> > <filter token="WEBINC" value="${webinc.xml}"/> > </filterset> > </copy> > </target> > > Try: > > <target name="merge-descriptor-3"> > <loadfile property="webinc.xml" srcFile="webinc.xml"/> > <loadfile property="web.xml" srcFile="web.xml"> > <filterchain> > <replacetokens> > <token key="WEBINC" value="${webinc.xml}"/> > </replacetokens> > </filterchain> > </loadfile> > <echo message="${web.xml}" file="dist/web.xml"/> > </target> > > or > > <target name="merge-descriptor-3"> > <loadfile property="webinc.xml" srcFile="webinc.xml"/> > <copy file="web.xml" toFile="dist/web.xml"> > <filterchain> > <replacetokens> > <token key="WEBINC" value="${webinc.xml}"/> > </replacetokens> > </filterchain> > </loadfile> > </target> > > > Cheers, > Magesh > > ----- Original Message ----- > From: "Kevin HaleBoyes" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, November 21, 2002 2:06 PM > Subject: replacing text in a file during a copy > > > > I have a web application deployment descriptor web.xml in a file. > > I've run the JspC task with the -webinc arguement which creates a > > portion of the deployment descriptor (webinc.xml) for the JSP > > mappings. > > > > I need to merge the webinc.xml file into the web.xml file when > > I build my project. > > > > I've tried the <loadfile> task with a <filterchain> which didn't > > work. I've also tried the <copy> task with a <filterset> but that > > also didn't work. > > > > Specifically, I have a token in the web.xml > > file marked @WEBINC@ and the following target: > > > > <target name="merge-descriptor-2"> > > <loadfile property="webinc.xml" srcFile="webinc.xml"/> > > <copy file="web.xml" toFile="dist/web.xml"> > > <filterset> > > <filter token="WEBINC" value="${webinc.xml}/> > > </filterset> > > </copy> > > </target> > > > > but this results in the following error message: > > file:/home/hb/Work/cml/tmp/build.xml:43: The value of attribute > > "value" must not contain the '<' character. > > > > So I tried this target... > > > > <target name="merge-descriptor-3"> > > <loadfile property="webinc.xml" srcFile="webinc.xml"/> > > <loadfile property="web.xml" srcFile="web.xml"> > > <filterchain> > > <replacetokens> > > <token key="WEBINC" value="${webinc.xml}"/> > > </replacetokens> > > </filterchain> > > </loadfile> > > <echo message="${web.xml}" file="dist/web.xml"> > > </target> > > > > and I get the same error. > > > > > > How can I perform this merge? > > Thanks, > > Kevin. > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > > http://mailplus.yahoo.com > > > > -- > > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > ===== Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd [EMAIL PROTECTED] Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>