This is an interface for an XSLT Processor engine.
More...
#include <XSLTProcessor.hpp>
Inherits ProblemListenerBase.
Inherited by XSLTEngineImpl.
List of all members.
Public Types
Public Member Functions
- XSLTProcessor ()
- virtual ~XSLTProcessor ()
- virtual void problem (eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)=0
- Function that is called when a problem event occurs.
- virtual void problem (eSource source, eClassification classification, const XalanDOMString &msg, const XalanNode *sourceNode)=0
- Function that is called when a problem event occurs.
- virtual void process (const XSLTInputSource &inputSource, const XSLTInputSource &stylesheetSource, XSLTResultTarget &outputTarget, StylesheetConstructionContext &constructionContext, StylesheetExecutionContext &executionContext)=0
- Transform the source tree to the output in the given result tree target.
- virtual void process (const XSLTInputSource &inputSource, XSLTResultTarget &outputTarget, StylesheetExecutionContext &executionContext)=0
- Transform the source tree to the output in the given result tree target.
- virtual StylesheetRoot * processStylesheet (const XSLTInputSource &stylesheetSource, StylesheetConstructionContext &constructionContext)=0
- Given a stylesheet input source, compile the stylesheet into an internal representation.
- virtual StylesheetRoot * processStylesheet (const XalanDOMString &xsldocURLString, StylesheetConstructionContext &constructionContext)=0
- Given a URI to an XSL stylesheet, compile the stylesheet into an internal representation.
- virtual void reset ()=0
- Reset the state.
- virtual XalanNode * getSourceTreeFromInput (const XSLTInputSource &inputSource)=0
- Given an input source, get the source tree.
- virtual const StylesheetRoot * getStylesheetRoot () const =0
- Retrieve the root stylesheet.
- virtual void setStylesheetRoot (const StylesheetRoot *theStylesheet)=0
- Set the root stylesheet.
- virtual void setExecutionContext (StylesheetExecutionContext *theExecutionContext)=0
- Set the execution context.
- virtual void resolveTopLevelParams (StylesheetExecutionContext &executionContext)=0
- Resolve the params that were pushed by the caller.
- virtual XMLParserLiaison & getXMLParserLiaison () const =0
- Get the XML Parser Liaison that this processor uses.
- virtual void getUniqueNamespaceValue (XalanDOMString &theValue)=0
- Generate a random namespace prefix guaranteed to be unique.
- virtual void setStylesheetParam (const XalanDOMString &key, XObjectPtr value)=0
- Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
- virtual void setStylesheetParam (const XalanDOMString &key, const XalanDOMString &expression)=0
- Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
- virtual void clearStylesheetParams ()=0
- Clear any stylesheet params.
- virtual FormatterListener * getFormatterListener () const =0
- Get the current formatter listener.
- virtual void setFormatterListener (FormatterListener *flistener)=0
- Set the current formatter listener.
- virtual size_type getTraceListeners () const =0
- Determine the number of trace listeners.
- virtual void addTraceListener (TraceListener *tl)=0
- Add a trace listener for the purposes of debugging and diagnosis.
- virtual void removeTraceListener (TraceListener *tl)=0
- Remove a trace listener.
- virtual void fireGenerateEvent (const GenerateEvent &ge)=0
- Fire a generate event.
- virtual void fireTraceEvent (const TracerEvent &te)=0
- Fire a trace event.
- virtual void fireSelectEvent (const SelectionEvent &se)=0
- Fire a selection event.
- virtual bool getTraceSelects () const =0
- If this is set to true, simple traces of template calls are made.
- virtual void traceSelect (StylesheetExecutionContext &executionContext, const ElemTemplateElement &theStylesheetElement, const NodeRefListBase &nl, const XPath *xpath) const =0
- Compose a diagnostic trace of the current selection.
- virtual void setQuietConflictWarnings (bool b)=0
- If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream.
- virtual void setDiagnosticsOutput (PrintWriter *pw)=0
- If this is set, diagnostics will be written to the m_diagnosticsPrintWriter stream.
Detailed Description
This is an interface for an XSLT Processor engine.
It's the responsibility of the implementation of the XSLTProcessor interface, collaborating with a XMLParserLiaison, the DOM, and the XPath engine, to transform a source tree of nodes into a result tree according to instructions and templates specified by a stylesheet tree. The methods process(...) are the primary public entry points.
If you reuse the processor instance, you should call reset() between calls.
Definition at line 85 of file XSLTProcessor.hpp.
Member Typedef Documentation
Constructor & Destructor Documentation
XSLTProcessor::XSLTProcessor |
( |
|
) |
|
virtual XSLTProcessor::~XSLTProcessor |
( |
|
) |
[virtual] |
Member Function Documentation
virtual void XSLTProcessor::addTraceListener |
( |
TraceListener * |
tl |
) |
[pure virtual] |
Add a trace listener for the purposes of debugging and diagnosis.
- Parameters:
-
| tl | pointer to listener to add |
virtual void XSLTProcessor::clearStylesheetParams |
( |
|
) |
[pure virtual] |
Clear any stylesheet params.
virtual void XSLTProcessor::fireGenerateEvent |
( |
const GenerateEvent & |
ge |
) |
[pure virtual] |
Fire a generate event.
- Parameters:
-
| ge | generate event to fire |
virtual void XSLTProcessor::fireSelectEvent |
( |
const SelectionEvent & |
se |
) |
[pure virtual] |
Fire a selection event.
- Parameters:
-
| se | selection event to fire |
virtual void XSLTProcessor::fireTraceEvent |
( |
const TracerEvent & |
te |
) |
[pure virtual] |
Fire a trace event.
- Parameters:
-
virtual FormatterListener* XSLTProcessor::getFormatterListener |
( |
|
) |
const [pure virtual] |
Get the current formatter listener.
- Returns:
- pointer to formatter listener
Given an input source, get the source tree.
- Parameters:
-
| inputSource | pointer to input source |
- Returns:
- source tree
virtual const StylesheetRoot* XSLTProcessor::getStylesheetRoot |
( |
|
) |
const [pure virtual] |
Retrieve the root stylesheet.
- Returns:
- pointer to root stylesheet
virtual size_type XSLTProcessor::getTraceListeners |
( |
|
) |
const [pure virtual] |
Determine the number of trace listeners.
- Returns:
- number of listeners
virtual bool XSLTProcessor::getTraceSelects |
( |
|
) |
const [pure virtual] |
If this is set to true, simple traces of template calls are made.
- Returns:
- true if traces made
virtual void XSLTProcessor::getUniqueNamespaceValue |
( |
XalanDOMString & |
theValue |
) |
[pure virtual] |
Generate a random namespace prefix guaranteed to be unique.
- Parameters:
-
| theValue | A string for returning the new prefix |
virtual XMLParserLiaison& XSLTProcessor::getXMLParserLiaison |
( |
|
) |
const [pure virtual] |
Get the XML Parser Liaison that this processor uses.
- Returns:
- XML parser liaison object
Function that is called when a problem event occurs.
- Parameters:
-
| source | Either eXMLParser, eXSLProcessor, or eXPATH. |
| classification | Either eMessage, eWarning, or eError. |
| locator | The current Locator instance for the stylesheet. Maybe be a null pointer. |
| sourceNode | The current source node, if any. |
| msg | The error message. |
Implements ProblemListenerBase.
Function that is called when a problem event occurs.
This version assumes location information is already formatted into the message.
- Parameters:
-
| source | either eXMLPARSER, eXSLPROCESSOR, or eXPATH |
| classification | either eMESSAGE, eERROR or eWARNING |
| msg | string message explaining the problem. |
Implements ProblemListenerBase.
Transform the source tree to the output in the given result tree target.
This function does not create a stylesheet tree, it assumes the provided StylesheetExecutionContext has the stylesheet tree to use. This is set by calling StylesheetExecutionContext::setStylesheetRoot().
- Parameters:
-
| inputSource | input source |
| outputTarget | output source tree |
| executionContext | current execution context |
- Exceptions:
-
Transform the source tree to the output in the given result tree target.
The processor will process the input source, the stylesheet source, and transform to the output target.
- Parameters:
-
| inputSource | input source |
| stylesheetSource | stylesheet source |
| outputTarget | output source tree |
| constructionContext | context for construction of objects |
| executionContext | current execution context |
- Exceptions:
-
Given a stylesheet input source, compile the stylesheet into an internal representation.
- Parameters:
-
| stylesheetSource | input source for the stylesheet |
| constructionContext | context for construction of objects |
- Returns:
- pointer to the compiled stylesheet object
- Exceptions:
-
Given a URI to an XSL stylesheet, compile the stylesheet into an internal representation.
- Parameters:
-
| xmldocURLString | URI to the input XML document |
| constructionContext | context for construction of objects |
- Returns:
- pointer to compiled stylesheet object
- Exceptions:
-
virtual void XSLTProcessor::removeTraceListener |
( |
TraceListener * |
tl |
) |
[pure virtual] |
Remove a trace listener.
- Parameters:
-
| tl | Trace listener to be removed. |
virtual void XSLTProcessor::reset |
( |
|
) |
[pure virtual] |
Reset the state.
This needs to be called after a process() call is invoked, if the processor is to be used again.
Resolve the params that were pushed by the caller.
virtual void XSLTProcessor::setDiagnosticsOutput |
( |
PrintWriter * |
pw |
) |
[pure virtual] |
If this is set, diagnostics will be written to the m_diagnosticsPrintWriter stream.
If the value is null, then diagnostics will be turned off.
- Parameters:
-
| pw | pointer to print writer |
Set the execution context.
Must be set if after calling setStylesheetRoot.
- Parameters:
-
| theExecutionContext | pointer to new execution context. |
virtual void XSLTProcessor::setFormatterListener |
( |
FormatterListener * |
flistener |
) |
[pure virtual] |
Set the current formatter listener.
- Parameters:
-
| flistener | pointer to new formatter listener |
virtual void XSLTProcessor::setQuietConflictWarnings |
( |
bool |
b |
) |
[pure virtual] |
If the quietConflictWarnings property is set to true, warnings about pattern conflicts won't be printed to the diagnostics stream.
True by default.
- Parameters:
-
| b | true if conflict warnings should be suppressed. |
Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
Top-level params are "sticky," and must be removed with a call to clearStylesheetParams().
- Parameters:
-
| key | name of the param |
| expression | expression that will be evaluated |
Set a top-level parameter, which the stylesheet can access with a top-level xsl:param.
Top-level params are "sticky," and must be removed with a call to clearStylesheetParams().
- Parameters:
-
| key | name of the parameter |
| value | XObject value for parameter |
virtual void XSLTProcessor::setStylesheetRoot |
( |
const StylesheetRoot * |
theStylesheet |
) |
[pure virtual] |
Set the root stylesheet.
- Parameters:
-
| theStylesheet | pointer to new root stylesheet |
Compose a diagnostic trace of the current selection.
- Parameters:
-
| executionContext | The current execution context |
| theStylesheetElement | The executing stylesheet element |
| nl | The list of selected nodes |
| xpath | A pointer to the XPath which generated the list of nodes, if any. |
The documentation for this class was generated from the following file: