Class ParseStylesheetAction

  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.core.AbstractSetAction
          extended by org.inria.ns.reflex.processor.xcl.ParseStylesheetAction
All Implemented Interfaces:
Computable, Executable, Presentable, NamespaceContextFactory

public class ParseStylesheetAction
extends AbstractSetAction

The <xcl:parse-stylesheet> element parses the XSLT stylesheet specified in the source attribute to a reusable Templates object.

<xcl:parse-stylesheet name="xslt" source="{$xsltFile}">
     <xcl:param name="" value="true">

The system-id attribute may be used to set (as an expression) an identifier for this stylesheet.

XSLT sources

The XSLT source processed may be :

URI resolution

URIs are resolved with the catalog in use by the processor instance. See URIReferenceResolver.

Error handling

See XMLError.

Passing parameters to the XSLT processor

Parameters may be set conditionnally (subactions can be used), like this :

  <xcl:parse-stylesheet name="xslt" source="{$xsltFile}">
     <xcl:if test="{$incremental}">
         <xcl:then><!--set the parameter only if it exists-->
             <xcl:param name="" value="{$incremental}">

Notice that in the terminology, an XSLT processor is using attributes ; the parameters are used to set the attributes of the XSLT processor.

Notice that, when invoked (see <xcl:transform>), it is also possible to use <xcl:param> to send parameters to the stylesheet.

Philippe Poulard
See Also:

Nested Class Summary
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
Field Summary
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
Constructor Summary
ParseStylesheetAction(Expression source, Expression systemId, Element element, AbstractAction parent)
          Create a new instance of ParseStylesheetAction.
Method Summary
 Object getComputedValue(DataSet dataSet)
          Return the computed value of the property, by parsing an XSLT stylesheet.
static AbstractAction unmarshal(AbstractAction parent, Element e)
          XML unmarshaller for ParseStylesheetAction.
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
addProperty, getComputedName, getName, getValue, runAction, scope, unmarshalScope
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ParseStylesheetAction(Expression source,
                             Expression systemId,
                             Element element,
                             AbstractAction parent)
                      throws XMLException
Create a new instance of ParseStylesheetAction.

source - The source of XSLT stylesheet to parse, that will be the value of the property, as an Expression.
systemId - The system identifier for the stylesheet as an expression, or null.
element - The element from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Method Detail


public static AbstractAction unmarshal(AbstractAction parent,
                                       Element e)
                                throws XMLException
XML unmarshaller for ParseStylesheetAction.

parent - The action depending from
e - The XML element to unmarshall.
The ParseStylesheetAction created.
UnmarshalException - When the element and its content is not those expected.


public Object getComputedValue(DataSet dataSet)
                        throws ExecutionException,
Return the computed value of the property, by parsing an XSLT stylesheet.

Specified by:
getComputedValue in interface Computable
Specified by:
getComputedValue in class AbstractSetAction
dataSet - The set of datas used when the name is computed.
The computed value of the property.
ExecutionException - If the computation can't be performed.