![]() | ![]() |
| Apache > Jakarta > Cactus > Running Tests > Ant | Docs for: v1.7.2 | v1.7 Last update: August 29 2011 |
WebXmlMerge Task
The task webxmlmerge provides a convenient way
to inject external definitions into a web deployment descriptor
(
This task currently merges only a subset of the definitions in a
descriptor, based on the most common usage scenarios:
Parameters
Nested Elementsxmlcatalog
The
The webxmlmerge task resolves the DTDs of web-app
descriptors (version 2.2 as well as 2.3) automatically to copies
stored in the JAR. So normally, you shouldn't need to specify a
nested
xmlcatalog element. Further, actually
specifying it will disable the default behaviour, and you'll need
to provide the web-app DTDs yourself.
ExamplesThe following example demonstrates the simplest-possible use of the task.
<webxmlmerge srcfile="${src.conf.dir}/web.xml"
destfile="${build.conf.dir}/web.xml"
mergefile="${cactus.ant.home}/confs/web.xml"/>
To improve speed of the parsing process and enable offline operation,
you should specify local paths to the web-app DTDs using a nested
<webxmlmerge srcfile="${src.conf.dir}/web.xml"
destfile="${build.conf.dir}/web.xml"
mergefile="${cactus.ant.home}/confs/web.xml">
<xmlcatalog>
<dtd publicid="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
location="${src.dtd.dir}/web-app_2_2.dtd"/>
<dtd publicid="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
location="${src.dtd.dir}/web-app_2_3.dtd"/>
</xmlcatalog>
</webxmlmerge>
The following example demonstrates using an
<xmlcatalog id="j2ee.dtds">
<dtd publicid="-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
location="${src.dtd.dir}/web-app_2_2.dtd"/>
<dtd publicid="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
location="${src.dtd.dir}/web-app_2_3.dtd"/>
</xmlcatalog>
<webxmlmerge srcfile="${src.conf.dir}/web.xml"
destfile="${build.conf.dir}/web.xml"
mergefile="${cactus.ant.home}/confs/web.xml"
indent="yes">
<xmlcatalog refid="j2ee.dtds"/>
</webxmlmerge>
|