Class XsltOutputTransformerContainer

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<java.io.Serializable,​Component>, IHeaderContributor, ITransformer, IRequestableComponent, org.apache.wicket.util.IHierarchical<Component>, org.apache.wicket.util.io.IClusterable

    public class XsltOutputTransformerContainer
    extends AbstractOutputTransformerContainer
    A container which output markup will be processes by a XSLT processor prior to writing the output into the web response. 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.

    The containers tag will be the root element of the xml data applied for transformation to ensure the xml data are well formed (single root element). In addition the attribute xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd is added to the root element to allow the XSL processor to handle the wicket namespace.

    Similar to this container, a IBehavior is available which does the same, but does not require an additional Container.

    Author:
    Juergen Donnerstag
    See Also:
    XsltTransformerBehavior, Serialized Form
    • Constructor Detail

      • XsltOutputTransformerContainer

        public XsltOutputTransformerContainer​(java.lang.String id,
                                              IModel<?> model,
                                              java.lang.String xslFilePath)
        Instead of using the default mechanism to determine the associated XSL file, it is given by the user.
        Parameters:
        id - the wicket:id
        model - the model (unused)
        xslFilePath - XSL input file path
        See Also:
        Component(String, IModel)
      • XsltOutputTransformerContainer

        public XsltOutputTransformerContainer​(java.lang.String id,
                                              IModel<?> model)
        Construct
        Parameters:
        id - the wicket:id
        model - the model (unused)
        See Also:
        Component(String, IModel)
      • XsltOutputTransformerContainer

        public XsltOutputTransformerContainer​(java.lang.String id)
        Construct
        Parameters:
        id - the wicket:id
        See Also:
        Component(String)
    • Method Detail

      • transform

        public java.lang.CharSequence transform​(Component component,
                                                java.lang.CharSequence output)
                                         throws java.lang.Exception
        Description copied from interface: ITransformer
        Will be invoked after all child components have been processed to allow for transforming the markup generated.
        Specified by:
        transform in interface ITransformer
        Specified by:
        transform in class AbstractOutputTransformerContainer
        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