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" <kzboyes@yahoo.com>
To: <ant-user@jakarta.apache.org>
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:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
|