org.apache.wicket.markup.transformer
Class XsltTransformer

java.lang.Object
  extended by org.apache.wicket.markup.transformer.XsltTransformer
All Implemented Interfaces:
ITransformer

public class XsltTransformer
extends java.lang.Object
implements ITransformer

A processor to XSLT transform the output generated by a Component.

Author:
Juergen Donnerstag
See Also:
XsltOutputTransformerContainer, XsltTransformerBehavior

Constructor Summary
XsltTransformer()
          Construct.
XsltTransformer(java.lang.String xslFile)
          Instead of using the default mechanism to determine the associated XSL file, it is given by the user.
 
Method Summary
 java.lang.CharSequence transform(Component component, java.lang.CharSequence output)
          Apply a XSL transformation to the markup generated by a component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XsltTransformer

public XsltTransformer()
Construct.


XsltTransformer

public XsltTransformer(java.lang.String xslFile)
Instead of using the default mechanism to determine the associated XSL file, it is given by the user.

Parameters:
xslFile - XSL input file path relative to the component's package. If the path does not end with .xsl, then it is considered as a basename and will be passed as-is to IResourceStreamLocator.locate(Class, String, String, java.util.Locale, String). All stylesheets must have the .xsl extension.
Method Detail

transform

public java.lang.CharSequence transform(Component component,
                                        java.lang.CharSequence output)
                                 throws java.lang.Exception
Apply a XSL transformation to the markup generated by a component. The *.xsl resource must be located in the same path as the nearest parent with an associated markup and must have a filename equal to the component's id.

Specified by:
transform in interface ITransformer
Parameters:
component - The associated Wicket component
output - The markup generated by the child components
Returns:
The output which will be appended to the original response
Throws:
java.lang.Exception
See Also:
ITransformer.transform(org.apache.wicket.Component, CharSequence)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.