|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xsl.process.ProcessingEnv
Processing environment containing information needed to process source nodes. Also includes various utility methods.
Constructor Summary | |
ProcessingEnv(ProcessingEnv iVal)
Construct a new processing environment that is a deep copy of the passed instance. |
|
ProcessingEnv(Stylesheet stylesheet,
Context context,
Document nodeFactory,
ErrorHandler errorHandler,
MessageHandler messageHandler,
ResultHandler topLevelResultHandler)
Constructs a new processing environment for the specified Stylesheet . |
Method Summary | |
void |
bindParameter(ExpandedQName name,
ExpressionValue value)
Bind an expression value to a parameter name |
static StringBuffer |
buildMsgPrologue(StringBuffer prologue,
Node contextNode)
Construct a message prologue with context information ( contextNode ) source
document URI and line number, if contextNode is an instance of com.novell.xml.dom.NodeImpl |
void |
clearParameters()
Clear any parameters that may be bound. |
Context |
getContext()
Return the expression context from this environment. |
Rule |
getCurrentRule()
Returns the current template rule (the current template rule chosen by matching a pattern). |
ErrorHandler |
getErrorHandler()
Returns the error handler to which processing errors and warnings should be reported. |
MessageHandler |
getMessageHandler()
Returns the message handler to which xsl:message content should be reported. |
Document |
getNodeFactory()
Get the Node factory object |
ExpressionValue |
getParameter(ExpandedQName name)
Get a bound parameter by name |
Stylesheet |
getStylesheet()
Return the stylesheet associated with this processing environment. |
ResultHandler |
getTopLevelResultHandler()
Return the result handler in effect for the top-level processing of the stylesheet. |
Rule |
popCurrentRule()
Remove the current template rule and restore the previous current template rule. |
void |
popParameters()
Pop previously bound template parameters after instantiation of a template. |
void |
popVariables()
Restore variable state after recursion. |
void |
process(Node source,
Mode mode,
ResultHandler result)
Uses this processing environment to process the specified source node in the specified mode, sending the result to the specified result handler. |
void |
processWithImports(Node source,
ResultHandler result)
Process the current node with imported rules only (xsl:apply-imports functionality) |
void |
processWithRule(Node source,
Mode mode,
ResultHandler result,
Rule rule)
Uses this processing environment to process the specified source node in the specified mode, sending the result to the specified result handler, given a Rule. |
void |
pushCurrentRule(Rule rule)
Set a template rule as the current template rule |
void |
pushParameters()
Push currently bound template parameters and clear in preparation for instantiating a template. |
void |
pushVariables()
Save current set of local variables and their values. |
void |
reportError(Node contextNode,
String key)
Report an error to the ErrorHandler with
source stylesheet context. |
void |
reportError(Node contextNode,
String key,
Object[] parms)
Report an error to the ErrorHandler with
source stylesheet context. |
void |
reportError(Node contextNode,
String key,
String parm0)
Report an error to the ErrorHandler with
source stylesheet context. |
void |
reportError(Node contextNode,
String key,
String parm0,
String parm1)
Report an error to the ErrorHandler with
source stylesheet context. |
void |
reportError(String msg)
Report an error to the ErrorHandler , convert
any thrown XSLException to a ProcessException |
void |
reportWarning(Node contextNode,
String key,
Object[] parms)
Report a warning to the ErrorHandler with
source stylesheet context. |
static void |
resultNamespace(ResultHandler result,
String prefix,
NamespaceName nsName)
Utility method for sending namespace nodes to result handler. |
void |
setNodeFactory(Document nodeFactory)
Set the Node factory object |
void |
setVariable(VariableTemplate variable)
Remember a variable and its current value in the current execution (run time) scope. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProcessingEnv(Stylesheet stylesheet, Context context, Document nodeFactory, ErrorHandler errorHandler, MessageHandler messageHandler, ResultHandler topLevelResultHandler)
Stylesheet
.
stylesheet
- the Stylesheet
doing the processingcontext
- The XPath expression context for this environment.errorHandler
- the error handler to report processing errors and
warnings tomessageHandler
- the message handler to report xsl:message messagestopLevelResultHandler
- the result handler for the top level of processingpublic ProcessingEnv(ProcessingEnv iVal)
iVal
- The ProcessingEnv to copy.Method Detail |
public ErrorHandler getErrorHandler()
public MessageHandler getMessageHandler()
public Context getContext()
public void process(Node source, Mode mode, ResultHandler result) throws XSLException
source
- the source node to be processedmode
- the mode to process inresult
- the handler to which results are sent
XSLException
- if a fatal error occurs during processingpublic void processWithImports(Node source, ResultHandler result) throws XSLException
source
- The source node to be processedresult
- The handler to which results are sent
XSLException
- if a fatal error occurs during processingpublic void processWithRule(Node source, Mode mode, ResultHandler result, Rule rule) throws XSLException
source
- the source node to be processedmode
- the mode to process inresult
- the handler to which results are sentrule
- the Rule to instantiate for the node
XSLException
- if a fatal error occurs during processingpublic Stylesheet getStylesheet()
public void bindParameter(ExpandedQName name, ExpressionValue value)
name
- The name of the parameter to bindvalue
- The expression value to bindpublic ExpressionValue getParameter(ExpandedQName name)
name
- The name of the parameter to retrieve
public void clearParameters()
public void pushParameters()
public void popParameters()
public void setVariable(VariableTemplate variable)
variable
- The local variable to rememberpublic void pushVariables()
public void popVariables()
public ResultHandler getTopLevelResultHandler()
public Rule getCurrentRule()
public void pushCurrentRule(Rule rule)
rule
- The template rule to set as the current template rule.public Rule popCurrentRule()
public Document getNodeFactory()
public void setNodeFactory(Document nodeFactory)
nodeFactory
- The Document object to use as the node factorypublic static void resultNamespace(ResultHandler result, String prefix, NamespaceName nsName) throws ResultException
result
- The ResultHandler to which to send the namespace node.prefix
- The prefix associated with the namespace nodensName
- The namespace name (URI) associated with the namespace node
ResultException
public void reportError(String msg) throws XSLException
ErrorHandler
, convert
any thrown XSLException
to a ProcessException
msg
- The message text
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public void reportError(Node contextNode, String key) throws XSLException
ErrorHandler
with
source stylesheet context.
key
- The key for the message format string in the properties file.
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public void reportError(Node contextNode, String key, String parm0) throws XSLException
ErrorHandler
with
source stylesheet context.
key
- The key for the message format string in the properties file.parm0
- The parameter for the message format string
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public void reportError(Node contextNode, String key, String parm0, String parm1) throws XSLException
ErrorHandler
with
source stylesheet context.
key
- The key for the message format string in the properties file.parm0
- The first parameter for the message format stringparm1
- The second parameter for the message format string
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public void reportError(Node contextNode, String key, Object[] parms) throws XSLException
ErrorHandler
with
source stylesheet context.
key
- The key for the message format string in the properties file.parms
- The parametersfor the message format string
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public void reportWarning(Node contextNode, String key, Object[] parms)
ErrorHandler
with
source stylesheet context.
key
- The key for the message format string in the properties file.parms
- The parametersfor the message format string
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.public static StringBuffer buildMsgPrologue(StringBuffer prologue, Node contextNode)
contextNode
) source
document URI and line number, if contextNode
is an instance of com.novell.xml.dom.NodeImpl
prologue
- The StringBuffer
in which to build the prologue. If null
,
a new StringBuffer
is allocated.contextNode
- The node that supplies the message context
XSLException
- if the ErrorHandler
throws an
error when ErrorHandler.error()
is called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |