org.milyn.templating.xslt
Class XalanJavabeanExtension

java.lang.Object
  extended by org.milyn.templating.xslt.XalanJavabeanExtension

public class XalanJavabeanExtension
extends Object

Javabean access Xalan XSLT extension for XSLT templating.

Provides XSLT template population using OGNL expressions embedded in an XSLT element or function extension. The OGNL expressions are targeted at the Javabean data gathered through use of the Smooks JavaBean Cartridge.

Usage

 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:xalan="http://xml.apache.org/xalan"
                xmlns:smooks-bean="org.milyn.templating.xslt.XalanJavabeanExtension"
                extension-element-prefixes="smooks-bean" 
                version="1.0">
 
        <xsl:template match="*">
                <!-- Using the XSLT extension element... -->
                <smooks-bean:select ognl="ognl-expression" />
 
                <!-- Using the XSLT extension function... -->
                <xsl:value-of select="smooks-bean:select('ognl-expression')"/>
 
        </xsl:template>
 
 </xsl:stylesheet>

Author:
tfennelly

Constructor Summary
XalanJavabeanExtension()
           
 
Method Summary
 Object select(String ognlExpression)
          Support OGNL based bean value injection via an XSLT extension function.
 Object select(org.apache.xalan.extensions.XSLProcessorContext context, org.apache.xalan.templates.ElemExtensionCall element)
          Support OGNL based bean value injection via an XSLT extension element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XalanJavabeanExtension

public XalanJavabeanExtension()
Method Detail

select

public Object select(org.apache.xalan.extensions.XSLProcessorContext context,
                     org.apache.xalan.templates.ElemExtensionCall element)
              throws ognl.OgnlException
Support OGNL based bean value injection via an XSLT extension element.

The OGNL expression is expected to be specified in the "ognl" attribute.

See Usage.

Parameters:
context - Processor context.
element - Extension element instance.
Returns:
The bean value, or null if the bean is unknown.
Throws:
ognl.OgnlException - Extension element syntax is incorrectly formed, or the OGNL expression is unspecified or its syntax is incorrectly formed.

select

public Object select(String ognlExpression)
              throws ognl.OgnlException
Support OGNL based bean value injection via an XSLT extension function.

The OGNL expression is expected to be specified in the function call.

See Usage.

Parameters:
ognlExpression - OGNL expression.
Returns:
The bean value, or null if the bean is unknown.
Throws:
ognl.OgnlException - OGNL expression is unspecified or its syntax is incorrectly formed.


Copyright © 2014. All Rights Reserved.