Package org.exolab.adaptx.xslt
Class RuleProcessor
- java.lang.Object
-
- org.exolab.adaptx.util.ErrorObserverAdapter
-
- org.exolab.adaptx.xslt.RuleProcessor
-
- All Implemented Interfaces:
ErrorObserver
public class RuleProcessor extends ErrorObserverAdapter
This class is the "template" rule processor which processes an XML document using it's XSLStylesheet. It's primary method #process starts with the "document" rule ("/"), specified or default, and runs through the XML Source tree processing all rules until there is nothing left to process.- Version:
- $Revision: 4530 $ $Date: 2004-07-29 05:29:07 +0200 (Thu, 29 Jul 2004) $
- Author:
- Keith Visco
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
XSL_VENDOR
The XSL vendor property namestatic java.lang.String
XSL_VENDOR_URL
The XSL vendor-url property namestatic java.lang.String
XSL_VERSION
The XSL version property name-
Fields inherited from interface org.exolab.adaptx.util.ErrorObserver
FATAL, NORMAL, WARNING
-
-
Constructor Summary
Constructors Constructor Description RuleProcessor(XSLTStylesheet xsl)
Create a RuleProcessor for the given XSL stylesheet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFunctionResolver(FunctionResolver fnResolver)
Adds the given FunctionResolver used for resovling extension functions.void
addMessageObserver(MessageObserver msgObserver)
Adds the given MessageObserver to this processors list of MessageObserversjava.lang.String
getParameter(java.lang.String name)
Returns the parameter value associated with the given name.java.lang.String
getProperty(java.lang.String name)
Returns the property value that is associated with the given name.URIResolver
getURIResolver()
Returns the URIResolver for resolving all URIs.void
process(XPathNode source, ResultHandler handler)
Processes the given XML Document using this processors stylesheet.MessageObserver
removeMessageObserver(MessageObserver msgObserver)
Removes the given MessageObserver from this processors list of MessageObserversvoid
setParameter(java.lang.String name, java.lang.String value)
Sets a property which may be accessed from the XSLT stylesheet via a call to the xslp:param extension functionvoid
setURIResolver(URIResolver resolver)
Sets the URIResolver for resolving all URIs.-
Methods inherited from class org.exolab.adaptx.util.ErrorObserverAdapter
addErrorObserver, receiveError, receiveError, receiveError, receiveError, receiveError, receiveError, removeAllErrorObservers, removeErrorObserver
-
-
-
-
Field Detail
-
XSL_VERSION
public static final java.lang.String XSL_VERSION
The XSL version property name- See Also:
- Constant Field Values
-
XSL_VENDOR
public static final java.lang.String XSL_VENDOR
The XSL vendor property name- See Also:
- Constant Field Values
-
XSL_VENDOR_URL
public static final java.lang.String XSL_VENDOR_URL
The XSL vendor-url property name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RuleProcessor
public RuleProcessor(XSLTStylesheet xsl)
Create a RuleProcessor for the given XSL stylesheet- Parameters:
xsl
- the XSLStylesheet to processdomParser
- the DOMParser to use when creating the result tree
-
-
Method Detail
-
addFunctionResolver
public void addFunctionResolver(FunctionResolver fnResolver)
Adds the given FunctionResolver used for resovling extension functions.- Parameters:
fnResolver
- the FunctionResolver to add- See Also:
org.exolab.adaptx.xpath.FunctionResolver
-
addMessageObserver
public void addMessageObserver(MessageObserver msgObserver)
Adds the given MessageObserver to this processors list of MessageObservers- Parameters:
msgObserver
- the MessageObserver to add to this processors list of MessageObservers
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Returns the parameter value associated with the given name. A call to #setParameter will associate a parameter- Parameters:
name
- the name of the parameter to retrieve the value of- Returns:
- the parameter value associated with the given name.
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Returns the property value that is associated with the given name.- Parameters:
name
- the name of the property to retrieve the value of- Returns:
- the property value that is associated with the given name.
-
getURIResolver
public URIResolver getURIResolver()
Returns the URIResolver for resolving all URIs.- Returns:
- the URIResolver for resolving all URIs.
-
process
public void process(XPathNode source, ResultHandler handler)
Processes the given XML Document using this processors stylesheet.- Parameters:
source
- the XPathNode to processhandler
- the ResultHandler for the result tree
-
removeMessageObserver
public MessageObserver removeMessageObserver(MessageObserver msgObserver)
Removes the given MessageObserver from this processors list of MessageObservers- Parameters:
msgObserver
- the MessageObserver to remove from this processors list of MessageObservers- Returns:
- the given MessageObserver if it was removed from the list, otherwise return null
-
setParameter
public void setParameter(java.lang.String name, java.lang.String value)
Sets a property which may be accessed from the XSLT stylesheet via a call to the xslp:param extension function- Parameters:
name
- the name of the parametervalue
- the value of the parameter
-
setURIResolver
public void setURIResolver(URIResolver resolver)
Sets the URIResolver for resolving all URIs. If null, the default URIResolver will be used.- Parameters:
resolver
- the URIResolver to use
-
-