org.jboss.soa.esb.actions.transformation.xslt
Class XsltAction

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractActionLifecycle
      extended by org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
          extended by org.jboss.soa.esb.actions.transformation.xslt.XsltAction
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor

public class XsltAction
extends AbstractActionPipelineProcessor

ESB Action that performs xslt transformation.

Example configuration:

<action name="xslt-transform" class="org.jboss.soa.esb.actions.transformation.xslt.XsltAction">
    <property name="templateFile" value="/sample.xsl"/>
    <property name="failOnWarning" value="true"/>
    <property name="validation" value="true"/>
    <property name="schemaFile" value="/sample.xsd"/>
    <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema"/>
    <property name="resultType" value="STRING"/>
 </action>
 
 
 

Configuration Properties

Validation Configuration XML Input Processing Outcome
Default

nothing

or

 <property name="validation" value="false"/>
  • malformed
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
  • well-formed
  • valid
  • pipeline continues
  • well-formed
  • invalid
  • transformation may fail
  • pipeline continues
DTD
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value="http://www.w3.org/TR/REC-xml"/>
or
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value=""/>
  • malformed
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
  • well-formed
  • valid
  • pipeline continues
  • well-formed
  • invalid
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
W3C XML Schema or RELAX NG
 <property name="validation" value="true"/>
or
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema"/>
or
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value="http://relaxng.org/ns/structure/1.0"/>
  • malformed
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
  • well-formed
  • valid
  • pipeline continues
  • well-formed
  • invalid
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
W3C XML Schema or RELAX NG with included schemaFile
 <property name="validation" value="true"/>
 <property name="schemaFile" value="/example.xsd"/>
 
or
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value="http://www.w3.org/2001/XMLSchema"/>
 <property name="schemaFile" value="/example.xsd"/>
 
or
 <property name="validation" value="true"/>
 <property name="schemaLanguage" value="http://relaxng.org/ns/structure/1.0"/>
 <property name="schemaFile" value="/example.rng"/>
 
  • malformed
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops
  • well-formed
  • valid
  • pipeline continues
  • well-formed
  • invalid
  • error logged
  • SAXParseException causes ActionProcessingException
  • pipeline stops

Since:
4.6
Author:
Daniel Bevenius, dward at jboss.org

Field Summary
 
Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
 
Constructor Summary
XsltAction(ConfigTree config)
          Sole constructor that parses the passed-in ConfigTree for mandatory attributes and sets the fields of this instance.
 
Method Summary
 int getNumberOfPooledTransfomers()
           
 TransformerFactoryConfig getTranformerConfig()
           
 void initialise()
          Creates the XSLTemplate.
 Message process(Message message)
          Performs the xsl transformation of the message payload.
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
processException, processSuccess
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
destroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
destroy
 

Constructor Detail

XsltAction

public XsltAction(ConfigTree config)
           throws ConfigurationException
Sole constructor that parses the passed-in ConfigTree for mandatory attributes and sets the fields of this instance.

Parameters:
config - The ConfigTree instance.
Throws:
ConfigurationException - if the mandatory attribute 'templateFile' has not been set.
Method Detail

process

public Message process(Message message)
                throws ActionProcessingException
Performs the xsl transformation of the message payload.

Parameters:
message - The ESB Message object whose payload should be transformed. The payload is extracted and set using contract specified by MessagePayloadProxy.
Returns:
Message The same ESB Message instance passed-in but with it payload transformed.
Throws:
ActionProcessingException - if an error occurs while trying to perform the transformation.

initialise

public void initialise()
                throws ActionLifecycleException
Creates the XSLTemplate.

Specified by:
initialise in interface ActionLifecycle
Overrides:
initialise in class AbstractActionLifecycle
Throws:
ActionLifecycleException - if the Templates could not be created.

getTranformerConfig

public TransformerFactoryConfig getTranformerConfig()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNumberOfPooledTransfomers

public int getNumberOfPooledTransfomers()