<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>WSO2 ESB - Smooks Mediator </title>
  <link href="css/esb-docs.css" rel="stylesheet" />
  <link href="styles/dist-docs.css" rel="stylesheet" type="text/css"
  media="all" />
</head>

<body>
<h2>Smooks Mediator</h2>

	<p>Smooks mediator can be used to apply lightweight transformations on messages in an efficient manner.
		Smooks is a powerful framework for processing, manipulating and transforming XML. More information
		about Smooks can be obtained from the official <a href="http://www.smooks.org">Smooks website</a>.
	</p>

	<p><strong>Configurations</strong> </p>
	<p>The Smooks mediator requires the transformation definition to be passed in as an external resource.
		This transformation can be specified as a local entry or be stored in the registry. The mediator UI
		enables you to point the mediator to an existing local entry or a registry resource.
	</p>
	
	<ul>
	<li>Smooks transformation configuartion : Smooks mediator requires the transformation definition to be passed in as an external resource.
	</li>
	
	<li>Input : User can define an 'input' as a 'Text' or 'XML' and need to provide a 'xpath' expression to pick exact 
		message block, else by default whole 'message body' will be selected by default.</li>
	<li>Output : Same like in  input, user can define how his output should be	</li>  
	
	</ul>


	<h3>Syntax</h3>
	
	<pre xml:space="preserve">
		&lt;smooks [config-key="string"]&gt;
			&lt;input [type="|text|xml"]  [regex="regex"]/&gt;
			&lt;output [type="|text|xml"]  [regex="regex"] [property="string"] [action="string"]/&gt;
		&lt;/smooks&gt;
	</pre>

<h3>UI Configuration</h3>

<p><img alt="Smooks Mediator" src="../smooks-mediator/docs/images/smooks.png" /> </p>

<p><strong>Smooks Mediator Configuartion</strong></p>

<h4>Configurations</h4>
<ul>
    <li>Configuration Key:</li>
	
	<p>
		Smooks  transformation definition to can be specified as a local entry or be stored in the registry. 
	</p>
   
    <li>Input :</li>   
	<p>
		User can define an 'input' as a 'Text' or 'XML' and need to provide a 'xpath' expression to pick exact 
		message block, else by default whole 'message body' will be selected by default.
    </p>
    <li>Output :</li>   
	<p>
		Same like in  input, user can define how his output should be. When user defines an 'output' expression there are<br/>
		additional operations can be performed.
	</p>

		<ul>
			<li>
				Add     : Selected node will be added as a child to the message.
			</li>
			<li>
				Replace : Selected node will be replaced in the message.
			</li>
			<li>
				Sibling : Selected node will be added as a sibling.
			</li>
		</ul>
		
	<p>
	When user defines an 'output' as a 'Property', property will be saved in the messagecontext for the future uses. 
	</p>
</ul>
 
</body>
</html>
