<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">

<document>
	<header>
		<title>Castor Transformer</title>
		<version>0.9</version>
		<type>Technical document</type>
		 <abstract>This document describes the castor transformer of Cocoon.</abstract>
	</header>
	<body>
		<s1 title="Castor Transformer">
			<p>With this transformer, a Bean that is stored in the session,Sitemap, Session, Request or
 				the Conext is marehalled to XML and inserted in the SAX stream at a given position.</p>
			<ul>
				<li>Name : CastorTransfomer</li>
				<li>Class: org.apache.cocoon.transformation.CastorTransformer</li>
				<li>Cacheable: no.</li>
			</ul>
<p>
 Configuation: The Castortransformer need to be configured with a default mapping. 
 This mapping is used as long as no other mapping is spezfied as the element
</p>

    <source>
     <![CDATA[
		<map:transformer name="CastorTransformer" src="org.apache.cocoon.transformation.CastorTransformer">
			<mapping>castor/mapping.xml</mapping>
		</map:transformer>

     ]]>
    </source>

<p>
The CastorTransfomer support only one Element <code>castor:InsertBean</code>. This
element is replaced with the marshalled object. The Object given through the
attrbute <code>name</code> will be searched in the <code>sitemap, request,
session</code> and at least in <code>application</code>
If the scope is explicitly given, e.g , the object will ge located only here
The Attribut <code>mapping</code> specifys the mapping to be used. If not given
the default mapping is used
</p>
<p>

    <source>
     <![CDATA[
	<zoo xmlns:castor="http://castor.exolab.org/cocoontransfomer">
		<castor:InsertBean name="Mouse"/> 
		<castor:InsertBean name="Hamster" mapping="castor/mapping_de.xml"/>
		<castor:InsertBean name="Elefant" scope="session"/> 
		<castor:InsertBean name="Elefant" scope="request"/> 
	</zoo>

     ]]>
    </source>

</p>

<p>
	Documentaion about the castor mapping is provided at the Castor Website 
	<link href="http://castor.exolab.org/xml-mapping.html">Castor XML Mapping </link>.

</p>
		</s1>
	</body>
</document>
