com.icl.saxon
Class RuleManager
java.lang.Object
com.icl.saxon.RuleManager
public class RuleManager
extends java.lang.Object
RuleManager maintains a set of template rules, one set for each mode
Enumeration | getAllModes() - Get a list of all registered modes
|
NodeHandler | getHandler(NodeInfo node, Context c) - Find the handler registered for a particular node in default mode.
|
NodeHandler | getHandler(NodeInfo node, Mode mode, Context c) - Find the handler registered for a particular node in a specific mode.
|
NodeHandler | getHandler(NodeInfo node, Mode mode, int min, int max, Context c) - Get a handler whose import precedence is in a particular range.
|
Mode | getMode(int modeNameCode) - Get the Mode object for a named mode.
|
StandaloneContext | getStandaloneContext() - Get the standalone context for XPath expressions and patterns.
|
void | resetHandlers() - Set up a new table of handlers.
|
void | setHandler(String pattern, NodeHandler eh) - Register a handler for a particular pattern.
|
void | setHandler(Pattern pattern, NodeHandler eh, Mode mode, int precedence) - Register a handler for a particular pattern.
|
void | setHandler(Pattern pattern, NodeHandler eh, Mode mode, int precedence, double priority) - Register a handler for a particular pattern.
|
void | setStandaloneContext(StandaloneContext context) - Set the standalone context for XPath expressions and patterns.
|
RuleManager
public RuleManager(NamePool pool)
create a RuleManager and initialise variables
getAllModes
public Enumeration getAllModes()
Get a list of all registered modes
- an Enumeration of all modes in use, excluding the default (unnamed) mode
getHandler
public NodeHandler getHandler(NodeInfo node,
Context c)
throws TransformerException
Find the handler registered for a particular node in default mode.
node
- The NodeInfo for the relevant node
- The handler that will process this
node. Returns the default handler for the type of node if there is no specific
one registered.
getHandler
public NodeHandler getHandler(NodeInfo node,
Mode mode,
Context c)
throws TransformerException
Find the handler registered for a particular node in a specific mode.
node
- The NodeInfo for the relevant nodemode
- The processing mode
- The handler that will process this node
Returns null if there is no specific handler registered.
getHandler
public NodeHandler getHandler(NodeInfo node,
Mode mode,
int min,
int max,
Context c)
throws XPathException
Get a handler whose import precedence is in a particular range. This is used to support
the xsl:apply-imports function
getMode
public Mode getMode(int modeNameCode)
Get the Mode object for a named mode. If there is not one already registered.
a new Mode is created.
modeNameCode
- The name code of the mode. Supply -1 to get the default
mode.
getStandaloneContext
public StandaloneContext getStandaloneContext()
Get the standalone context for XPath expressions and patterns. This is
used only for expressions and patterns occurring outside the context
of a stylesheet.
- the StandaloneContext associated with this RuleManager. Creates a new
one if none has been set explicitly.
resetHandlers
public void resetHandlers()
Set up a new table of handlers.
setHandler
public void setHandler(String pattern,
NodeHandler eh)
throws XPathException
Register a handler for a particular pattern. This is a convenience interface
that calls setHandler(pattern, eh, mode, precedence) with default mode and precedence.
pattern
- A match patterneh
- The NodeHandler to be used
NodeHandler
, Pattern
setHandler
public void setHandler(Pattern pattern,
NodeHandler eh,
Mode mode,
int precedence)
Register a handler for a particular pattern. The priority of the rule
is the default priority for the pattern, which depends on the syntax of
the pattern suppllied.
pattern
- A match patterneh
- The ElementHandler to be usedmode
- The processing modeprecedence
- The import precedence (use 0 by default)
setHandler
public void setHandler(Pattern pattern,
NodeHandler eh,
Mode mode,
int precedence,
double priority)
Register a handler for a particular pattern.
pattern
- Must be a valid Pattern.eh
- The ElementHandler to be usedmode
- The processing mode to which this element handler appliesprecedence
- The import precedence of this rulepriority
- The priority of the rule: if an element matches several patterns, the
one with highest priority is used
NodeHandler
, Pattern
setStandaloneContext
public void setStandaloneContext(StandaloneContext context)
Set the standalone context for XPath expressions and patterns. This is
used only for expressions and patterns occurring outside the context
of a stylesheet.