You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2007/05/02 12:00:32 UTC

[DAISY] Created: XPatch

A new document has been created.

http://cocoon.zones.apache.org/daisy/documentation/1360.html

Document ID: 1360
Branch: main
Language: default
Name: XPatch
Document Type: Cocoon Document
Created: 5/2/07 10:00:27 AM
Creator (owner): Reinhard Pötz
State: publish

Parts
=====

Content
-------
Mime type: text/xml
Size: 1834 bytes
Content:
<html>
<body>

<p>The xpatch mechanism enables you to split up your web.xml and put the
snippets into the block it belongs too. It takes all *.xweb files from
<tt>src/main/resources/META-INF/cocoon/xpatch</tt> and applies them to the
generated <tt>web.xml</tt> file that you will find in
<tt>target/rcl/webapp/WEB-INF/web.xml</tt>.</p>

<p>Here is an example of an xweb file:</p>

<pre>&lt;xweb <strong>xpath</strong>="/web-app" 
      <strong>unless</strong>="comment()[contains(., 'Xindice XML-RPC Server servlet configuration')]" 
      <strong>insert-after</strong>="servlet[last()]"&gt;

  &lt;!-- XMLDB Block, Xindice XML-RPC Server servlet configuration --&gt;
  &lt;servlet&gt;
    &lt;servlet-name&gt;Xindice&lt;/servlet-name&gt;
    &lt;display-name&gt;Xindice XML-RPC Server&lt;/display-name&gt;
    &lt;servlet-class&gt;org.apache.xindice.server.XindiceServlet&lt;/servlet-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;xindice.configuration&lt;/param-name&gt;
      &lt;param-value&gt;WEB-INF/xindice.xml&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
&lt;/xweb&gt;
</pre>

<p>This xweb file adds the Xindice-RPC Server servlet to your web.xml.</p>

<h3>Syntax</h3>

<table>
<tbody>
<tr>
<th/>
<th>
<p>description</p>
</th>
</tr>
<tr>
<th>
<p>xweb</p>
</th>
<td>
<p>That's the root element. Everything it contains will be applied.</p>
</td>
</tr>
<tr>
<th>
<p>@xpath</p>
</th>
<td>
<p>The xpatch within web.xml where the xweb snippet should be applied to.</p>
</td>
</tr>
<tr>
<th>
<p>@unless</p>
</th>
<td>
<p>A condition when the patch should NOT be applied.</p>
</td>
</tr>
<tr>
<th>
<p>@insert-after</p>
</th>
<td valign="top">
<p>Define the exact position within result of the xpath.</p>
</td>
</tr>
</tbody>
</table>

</body>
</html>

Collections
===========
The document belongs to the following collections: cdocs-maven-plugin