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:50:26 UTC

[DAISY] Updated: cTwIG - Cocoon Two Idiots Guide - Basic XML/XSL Transformation

A document has been updated:

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

Document ID: 647
Branch: main
Language: default
Name: cTwIG - Cocoon Two Idiots Guide - Basic XML/XSL Transformation (unchanged)
Document Type: Document (unchanged)
Updated on: 9/22/05 2:50:06 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: 5567 bytes (previous version: 5573 bytes)
Content diff:
(12 equal lines skipped)
    (<a href="ctwig/sample/transformations/basic01/basic01-01.xml">basic01-01.xml</a>):
    </p>
    
--- <pre>
---   &lt;?xml version="1.0"?&gt;
+++ <pre>  &lt;?xml version="1.0"?&gt;
      &lt;page&gt;
        &lt;title&gt;Basic XML/XSL Transformation Example - BASIC01-01.XML&lt;/title&gt;
        &lt;greeting&gt;Hello World&lt;/greeting&gt;
(4 equal lines skipped)
    (<a href="ctwig/sample/transformations/basic01/basic01-01.xsl">basic01-01.xsl</a>):
    </p>
    
--- <pre>
---   &lt;?xml version="1.0"?&gt;
+++ <pre>  &lt;?xml version="1.0"?&gt;
      &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
    
      &lt;xsl:template match="page"&gt;
(22 equal lines skipped)
    transforming the above files together you just need to add the following code
    into the last "pipeline" section:</p>
    
--- <pre>
---   &lt;map:match pattern="ctwig/basic01-01.xml"&gt; 
+++ <pre>  &lt;map:match pattern="ctwig/basic01-01.xml"&gt; 
        &lt;map:generate type="file" src="ctwig/basic01-01.xml"/&gt; 
        &lt;map:transform type="xslt" src="ctwig/basic01-01.xsl"/&gt; 
        &lt;map:serialize/&gt; 
(18 equal lines skipped)
    makes things easier by allowing wildcards in the pattern matching argument. If
    the above section is replaced with the following:</p>
    
--- <pre>
---   &lt;map:match pattern="ctwig/*.xml"&gt; 
+++ <pre>  &lt;map:match pattern="ctwig/*.xml"&gt; 
        &lt;map:generate type="file" src="ctwig/{1}.xml"/&gt; 
        &lt;map:transform type="xslt" src="ctwig/{1}.xsl"/&gt; 
        &lt;map:serialize/&gt; 
(8 equal lines skipped)
    <p>This also allows us to do a kind of request re-writing function. Take the
    following sitemap construct:</p>
    
--- <pre>
---   &lt;map:match pattern="ctwig/*.html"&gt; 
+++ <pre>  &lt;map:match pattern="ctwig/*.html"&gt; 
        &lt;map:generate type="file" src="ctwig/{1}.xml"/&gt; 
        &lt;map:transform type="xslt" src="ctwig/{1}.xsl"/&gt; 
        &lt;map:serialize/&gt; 
(19 equal lines skipped)
    transforming them into a source code view. This again is achieved using the
    sitemap file with a construct similar to the following:</p>
    
--- <pre>
---   &lt;map:match pattern="ctwig/*.html"&gt; 
+++ <pre>  &lt;map:match pattern="ctwig/*.html"&gt; 
        &lt;map:generate type="file" src="ctwig/{1}.xml"/&gt; 
        &lt;map:transform type="xslt" src="ctwig/file2html.xsl"/&gt; 
        &lt;map:serialize/&gt; 
(10 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

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

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