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>...
<map:components>
...
<map:transformers default="xslt">
(5 equal lines skipped)
<p>Next define in your pipeline to use the XIncludeTransformer</p>
--- <pre>
--- <map:match pattern="xinc/simple-xinc">
+++ <pre><map:match pattern="xinc/simple-xinc">
<map:generate src="xinc/simple-xinc.xml"/>
<map:transform type="xinclude"/>
<map:transform src="stylesheets/page/simple-page2html.xsl"/>
(7 equal lines skipped)
the include element to get replaced by the included content. The simple-xinc.xml
may look like this:</p>
--- <pre>
--- <?xml version="1.0" encoding="UTF-8"?>
+++ <pre><?xml version="1.0" encoding="UTF-8"?>
<page
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Hello</title>
(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>
--- <?xml version="1.0"?>
+++ <pre><?xml version="1.0"?>
<p>
I am <strong>included</strong> 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>
--- <?xml version="1.0" encoding="UTF-8"?>
+++ <pre><?xml version="1.0" encoding="UTF-8"?>
<page
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Hello</title>
(12 equal lines skipped)
Fields
======
no changes
Links
=====
no changes
Custom Fields
=============
no changes
Collections
===========
no changes