public class XsltTransformerBehavior extends AbstractTransformerBehavior
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.
The reason why the transformer can not be used to XSLT the ListViews output is because of the ListViews markup being reused for each ListItem. Please use a XsltOutputTransformerContainer instead. Note: if the ListView is used to print a list of <tr> tags, than the transformer container must enclose the <table> tag as well to be HTML compliant.
AbstractOutputTransformerContainer
,
XsltOutputTransformerContainer
,
Serialized FormConstructor and Description |
---|
XsltTransformerBehavior()
Construct.
|
XsltTransformerBehavior(String xslFilePath) |
Modifier and Type | Method and Description |
---|---|
void |
bind(Component component)
Bind this handler to the given component.
|
void |
onComponentTag(Component component,
ComponentTag tag)
Called any time a component that has this behavior registered is rendering the component tag.
|
CharSequence |
transform(Component component,
CharSequence output)
Will be invoked after all child components have been processed to allow for transforming the
markup generated.
|
afterRender, beforeRender, detach, newResponse
canCallListener, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHead, unbind
public XsltTransformerBehavior()
public XsltTransformerBehavior(String xslFilePath)
xslFilePath
- XsltTransformer.XsltTransformer(String)
public void onComponentTag(Component component, ComponentTag tag)
Behavior
onComponentTag
in class Behavior
component
- the component that renders this tag currentlytag
- the tag that is renderedpublic CharSequence transform(Component component, CharSequence output) throws Exception
ITransformer
transform
in interface ITransformer
transform
in class AbstractTransformerBehavior
component
- The associated Wicket componentoutput
- The markup generated by the child componentsException
public void bind(Component component)
Behavior
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.