cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Huttar" <>
Subject RE: SourceWritingTransformer
Date Mon, 12 Jan 2004 23:03:51 GMT
I assume you have looked at the examples at

Here's what we use (under Cocoon 2.1.2).
In the sitemap:

    <map:view name="source" from-label="source">
      <map:transform type="write-source">
        <!-- <map:parameter name="serializer" value="text" /> --><!-- unnecessary
      <map:transform src="transforms/post-write-source.xsl" />
      <map:match pattern="*/*/cell/*/s*/*.xsl"> <!-- Stylesheet  to generate Row
5 source code -->
        <map:generate src="cocoon:/base/{1}/{2}/{3}/s{4}" label="raw" />
        <map:transform src="archFrame/s{4}/{3}/{5}.xsl" label="source"> <!-- here
          <map:parameter name="system" value="{1}" />
        <map:transform src="transforms/source.xsl" label="raw2">
          <map:parameter name="system" value="{1}" />
          <map:parameter name="state" value="{2}" />
        <map:serialize type="html"/>

So if the parameter ?cocoon-view=source is included on the request URL,
the output of the transform labeled "here" goes to the SourceWritingTransformer;
otherwise it goes to a different transformer (post-write-source.html)
that formats it as human-friendly HTML.

An example of the input to the SourceWritingTransformer:

<pages xmlns:sil=""
xmlns:xsp-request="" xmlns:xsp=""
  <architect>Gary S</architect>
  <role id="admin">Ethnologue editor</role>
  <source:write serializer="xml">
	 <xsp:page language="java" sil:dummy="" xsp-request:dummy="">
		<role>Ethnologue editor</role>
  <source:write serializer="text" xmlns:source="">
      <dummy>-- Oracle 9i database schema for Ethnologue
          -- Automatically generated from GEM system model
          -- Define the tables

		CREATE OR REPLACE TABLE Alternate_Dialect_Name (

-----Original Message-----
From: Varalakshmi Kollipara
Sent: Friday, January 09, 2004 4:05 PM
To: ''
Subject: SourceWritingTransformer

Hello everyone can anyone send me some SourceWritingTansformer examples.

Thanks in advance,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message