blob: f0e0ca4a8f34e4a9052d3c817c0cf8ca978ff609 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Write DOM Session Transformer</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="Carsten Ziegeler" name="DC.Creator">
<meta content="Sven Beauprez" name="DC.Creator">
<meta content="Davanum Srinivas" name="DC.Creator">
<meta content="This document describes the write dom session transformer of Cocoon." name="DC.Description">
</head>
<body>
<h1>Write DOM Session Transformer</h1>
<p>Make a DOM object from SAX events and write it to the session.</p>
<ul>
<li>Name : writeDOMsession</li>
<li>Class: org.apache.cocoon.transformation.WriteDOMSessionTransformer</li>
<li>Cacheable: no.</li>
</ul>
<p>
If you only use the FilterTransformer in combination with the SQLTransformer,
you have to query the database each time the user wants to see another part of
the result. You can better store the result in the session after the first
request and retrieve the result from the session for the subsequent requests.
This can be done by using a selector, which checks if the data is available in
the session or not.
</p>
<p>
WriteDOMSessionTransformer can build a DOM starting from a given element (which
will be the root of the DOM tree) and store it in the session. If you want to
store the result of a query, you have to add following to the sitemap:
</p>
<pre class="code">
&lt;map:transform type="writeDOMsession"&gt;
&lt;map:parameter name="dom-name" value="DBresult"/&gt;
&lt;map:parameter name="dom-root-element" value="rowset"/&gt;
&lt;/map:transform&gt;
</pre>
<p>
The transformer will build a DOM tree with rowset as root element and will store
it in the session with the name "DBresult".
</p>
<p>
Note: most of the times, it is not smart to keep the output XML of the
SQLTransformer in the session. Check if it is better to do the necessary
transformations first, so that you get a smaller DOM, and then put the result in
the session. You probably will be able to use the FilterTransformer on the
transformed XML also.
</p>
<p>
The WriteDOMSessionTransformer is a standalone component, you don't need to use
it in combination with the SQLTransformer.
</p>
</body>
</html>