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/10/14 16:57:29 UTC

[DAISY] Updated: XInclude Transformer

A document has been updated:

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

Document ID: 458
Branch: main
Language: default
Name: XInclude Transformer (unchanged)
Document Type: Document (unchanged)
Updated on: 10/14/05 2:57:13 PM
Updated by: Helma van der Linden

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 3104 bytes (previous version: 3108 bytes)
Content diff:
(10 equal lines skipped)
    <ul>
    <li>Name : xinclude</li>
    <li>Class: org.apache.cocoon.transformation.XIncludeTransformer</li>
--- <li>Cacheable: no.</li>
+++ <li>Cacheable: yes.</li>
    </ul>
    
    <p>You can include either simple text, or xml content. Including xml content --
(15 equal lines skipped)
    
    <p>Add the XIncludetransfomer to the components in your sitemap.xmap</p>
    
--- <pre>
--- ...
+++ <pre>...
    &lt;map:components&gt;
    ...
      &lt;map:transformers default="xslt"&gt;
(5 equal lines skipped)
    
    <p>Next define in your pipeline to use the XIncludeTransformer</p>
    
--- <pre>
--- &lt;map:match pattern="xinc/simple-xinc"&gt;
+++ <pre>&lt;map:match pattern="xinc/simple-xinc"&gt;
      &lt;map:generate src="xinc/simple-xinc.xml"/&gt;
      &lt;map:transform type="xinclude"/&gt;
      &lt;map:transform src="stylesheets/page/simple-page2html.xsl"/&gt;
(7 equal lines skipped)
    the include element to get replaced by the included content. The simple-xinc.xml
    may look like this:</p>
    
--- <pre>
--- &lt;?xml version="1.0" encoding="UTF-8"?&gt;
+++ <pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;page 
      xmlns:xi="http://www.w3.org/2001/XInclude"&gt;
      &lt;title&gt;Hello&lt;/title&gt;
(7 equal lines skipped)
    <p>Next you should define the include.xml file which is included. A simple
    include.xml might look like this:</p>
    
--- <pre>
--- &lt;?xml version="1.0"?&gt;
+++ <pre>&lt;?xml version="1.0"?&gt;
    &lt;p&gt;
      I am &lt;strong&gt;included&lt;/strong&gt; by XIncludeTransformer.
      I come from "include.xml".
(3 equal lines skipped)
    <p>Now finally we have everything put together the xml content after the
    XIncludeTransformer processing will look like this:</p>
    
--- <pre>
--- &lt;?xml version="1.0" encoding="UTF-8"?&gt;
+++ <pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;page 
      xmlns:xi="http://www.w3.org/2001/XInclude"&gt;
      &lt;title&gt;Hello&lt;/title&gt;
(12 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes