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 2005/09/22 16:01:27 UTC

[DAISY] Created: Cocoon Sitemap Transformer FAQs

A new document has been created.

http://cocoon.zones.apache.org/daisy/legacydocs/717.html

Document ID: 717
Branch: main
Language: default
Name: Cocoon Sitemap Transformer FAQs
Document Type: Document
Created: 9/22/05 2:01:16 PM
Creator (owner): Helma van der Linden
State: publish

Parts
=====

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

<h2>What is a transformer?</h2>

<p>A transformer is the central point in a sitemap pipeline. Within a pipeline
match, transformers consume SAX events and emit SAX events. Transformers are
placed inside a pipeline matcher between a generator and a serializer. You can
include several transformers within a pipeline matcher. Any pipeline matcher
containing a generator and transformer must end with a serializer.</p>

<p>In the sitemap file, each transformer has a unique name which is mapped to a
java class. One transformer name must be declared as the default transformer.
Each transformer may have additional configuration information specified in
child elements.</p>

<p>For more conceptual information about transformers see
<a href="daisy:580">the sitemap</a>. For detailed descriptions about all of the
available Cocoon transformers, see the user's guide document
<a href="daisy:450">Transformers in Cocoon</a>. You may also wish to consult the
Cocoon API documentation.</p>

<h2>What are the similarities and differences of XInclude and CInclude
Transformers?</h2>

<p>The XInclude and CInclude transformers both provide mechanisms to include
content from other documents. Both also support cocoon:/ protocol (i.e. they use
Cocoon's resolver).</p>

<p>XIncludeTransformer differences</p>

<ul>
<li>Implements the W3C XInclude specification.</li>
<li>Allows you to include text or xml content (via parse="text|xml").</li>
<li>Allows you to use XPointer syntax (via '#' or XPointer() syntax) within href
attribute. However, support of XPointer requires random access to the object
model of XML document to be included. Thus, it is expensive to construct in
runtime. If you are including a whole document, it's better to use CInclude
which supports straightforward text inclusion.</li>
<li>Has only one implementation, XIncludeTransformer, which is
<strong>not</strong> cacheable.</li>
</ul>

<p>CIncludeTransformer differences</p>

<ul>
<li>Helps you serve documents with inclusions and tags in xinclude namespace.
This means that if a document (with both xinclude <em>and</em> cinclude tags) is
processed by the CIncludeTransformer, its xinclude tags will remain intact.
</li>
<li>Gives you the option to specify the element, namespace, and prefix for the
included content (e.g. element="wrapper_element" ns="wrapper_ns"
prefix="wrapper_prefix")</li>
<li>Has two implementations: (1) a cacheable implementation,
CachingCIncludeTransformer, and (2) a non-cacheable implementation,
CIncludeTransformer, (used in Cocoon samples).</li>
</ul>

<p>Consult the user documentation for more information about the
<a href="daisy:458">XIncludeTransformer</a> and
<a href="daisy:445">CIncludeTransformer</a>. Please note that an
IncludeTransformer, with support for both cinclude and xinclude as well as a
configurable namespace, is planned for a future release.</p>

</body>
</html>

Collections
===========
The document belongs to the following collections: legacydocs