Xalan-C++ API Documentation
Xalan-C++ API Documentation
The Xalan-C++ XSL Transformer Version 1.0
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
XSLTProcessor Class Reference
This is an interface for an XSLT Processor engine.
More...
#include <XSLTProcessor.hpp>
Inheritance diagram for XSLTProcessor:
List of all members.Public Methods
- XSLTProcessor ()
- virtual ~XSLTProcessor ()
- virtual void process ( XSLTInputSource& inputSource, XSLTInputSource& stylesheetSource, XSLTResultTarget& outputTarget, StylesheetConstructionContext& constructionContext, StylesheetExecutionContext& executionContext) = 0
- Transform the source tree to the output in the given result tree target. More...
- virtual void process ( XSLTInputSource& inputSource, XSLTResultTarget& outputTarget, StylesheetExecutionContext& executionContext) = 0
- Transform the source tree to the output in the given result tree target. More...
- virtual StylesheetRoot* processStylesheet ( XSLTInputSource& stylesheetSource, StylesheetConstructionContext& constructionContext) = 0
- Given a stylesheet input source, compile the stylesheet into an internal representation. More...
- virtual StylesheetRoot* processStylesheet ( const XalanDOMString& xsldocURLString, StylesheetConstructionContext& constructionContext) = 0
- Given a URI to an XSL stylesheet, compile the stylesheet into an internal representation. More...
- virtual void reset () = 0
- Reset the state. More...
- virtual XalanDocument* getDOMFactory () const = 0
- Get a factory for creating new target nodes. More...
- virtual XalanNode* getSourceTreeFromInput (XSLTInputSource& inputSource) = 0
- Given an input source, get the source tree. More...
- virtual void outputToResultTree ( StylesheetExecutionContext& executionContext, const XObject& xobj) = 0
- Output an object to the result tree by doing the right conversions. More...
- virtual void resetCurrentState ( XalanNode* sourceTree, XalanNode* xmlNode) = 0
- Reset the state of execution to node 'xmlNode' in source tree 'sourceTree.'. More...
- virtual const StylesheetRoot* getStylesheetRoot () const = 0
- Retrieve the root stylesheet. More...
- virtual void setStylesheetRoot (const StylesheetRoot* theStylesheet) = 0
- Set the root stylesheet. More...
- virtual void setExecutionContext (StylesheetExecutionContext* theExecutionContext) = 0
- Set the execution context. More...
- virtual XalanDOMString evaluateAttrVal ( XalanNode* contextNode, const PrefixResolver& namespaceContext, const XalanDOMString& stringedValue, XPathExecutionContext& executionContext) = 0
- Evaluates attribute values for attribute templates (Stuff in curly {} braces that hold expressions). More...
- virtual ResultTreeFragBase* createResultTreeFrag ( StylesheetExecutionContext& executionContext, const ElemTemplateElement& templateChild, XalanNode* sourceTree, XalanNode* sourceNode, const QName& mode) = 0
- Given a stylesheet element, create a result tree fragment from its contents. More...
- virtual ResultTreeFragBase* createResultTreeFrag () const = 0
- Create an empty result tree fragment. More...
- 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. More...
- virtual const XalanDOMString getUniqueNSValue () const = 0
- Generate a random namespace prefix guaranteed to be unique. More...
- virtual void setStylesheetParam ( const XalanDOMString& key, XObject* value) = 0
- Push a top-level stylesheet parameter. More...
- virtual void setStylesheetParam ( const XalanDOMString& key, const XalanDOMString& expression) = 0
- Push a top-level stylesheet parameter. More...
- virtual bool shouldStripSourceNode ( XPathExecutionContext& executionContext, const XalanNode& node) const = 0
- Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node. More...
- virtual FormatterListener* getFormatterListener () const = 0
- Get the current formatter listener. More...
- virtual void setFormatterListener (FormatterListener* flistener) = 0
- Set the current formatter listener. More...
- virtual unsigned long getTraceListeners () const = 0
- Determine the number of trace listeners. More...
- virtual void addTraceListener (TraceListener* tl) = 0
- Add a trace listener for the purposes of debugging and diagnosis. More...
- virtual void removeTraceListener (TraceListener* tl) = 0
- Remove a trace listener. More...
- virtual void fireGenerateEvent (const GenerateEvent& ge) = 0
- Fire a generate event. More...
- virtual void fireTraceEvent (const TracerEvent& te) = 0
- Fire a trace event. More...
- virtual void fireSelectEvent (const SelectionEvent& se) = 0
- Fire a selection event. More...
- virtual bool getTraceSelects () const = 0
- If this is set to true, simple traces of template calls are made. More...
- virtual void traceSelect ( const XalanElement& theTemplate, const NodeRefListBase& nl) const = 0
- Compose a diagnostic trace of the current selection. More...
- 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. More...
- virtual void setDiagnosticsOutput (PrintWriter* pw) = 0
- If this is set, diagnostics will be written to the m_diagnosticsPrintWriter stream. More...
- virtual void message ( const XalanDOMString& msg, const XalanNode* styleNode = 0, const XalanNode* sourceNode = 0) const = 0
- Give the user a message. More...
- virtual void warn ( const XalanDOMString& msg, const XalanNode* styleNode = 0, const XalanNode* sourceNode = 0) const = 0
- Tell the user of an warning, and probably throw an exception. More...
- virtual void error ( const XalanDOMString& msg, const XalanNode* styleNode = 0, const XalanNode* sourceNode = 0) const = 0
- Tell the user of an error, and probably throw an exception. More...
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.
Constructor & Destructor Documentation
XSLTProcessor::XSLTProcessor () |
|
virtual XSLTProcessor::~XSLTProcessor () [virtual] |
|
Member Function Documentation
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
|
Reimplemented in XSLTEngineImpl.
Create an empty result tree fragment.
Caller owns the memory.
-
Returns:
-
pointer to an object that represents the result tree fragment
Reimplemented in XSLTEngineImpl.
Given a stylesheet element, create a result tree fragment from its contents.
Caller owns the memory.
-
Parameters:
-
templateChild
|
template element that holds the fragment
|
sourceTree
|
source tree document context
|
sourceNode
|
current source context node
|
mode
|
mode under which the template is operating
|
-
Returns:
-
pointer to an object that represents the result tree fragment
-
Exceptions:
-
Reimplemented in XSLTEngineImpl.
Tell the user of an error, and probably throw an exception.
-
Parameters:
-
msg
|
text of message to output
|
sourceNode
|
node in source where error occurred
|
styleNode
|
node in stylesheet where error occurred
|
-
Exceptions:
-
Reimplemented in XSLTEngineImpl.
Evaluates attribute values for attribute templates (Stuff in curly {} braces that hold expressions).
-
Parameters:
-
contextNode
|
current node in the source tree
|
namespaceContext
|
current namespace context for the
pattern-by-example structures when parsing
expressions
|
stringedValue
|
attribute value to be processed
|
executionContext
|
current execution context
|
-
Returns:
-
processed stringedValue with attribute templates resolved
-
Exceptions:
-
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::fireGenerateEvent (
|
const GenerateEvent & ge) [pure virtual] |
|
Fire a generate event.
-
Parameters:
-
ge
|
generate event to fire
|
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::fireSelectEvent (
|
const SelectionEvent & se) [pure virtual] |
|
Fire a selection event.
-
Parameters:
-
se
|
selection event to fire
|
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::fireTraceEvent (
|
const TracerEvent & te) [pure virtual] |
|
XalanDocument * XSLTProcessor::getDOMFactory () const [pure virtual] |
|
Get a factory for creating new target nodes.
-
Returns:
-
The factory
Get the current formatter listener.
-
Returns:
-
pointer to formatter listener
Reimplemented in XSLTEngineImpl.
Given an input source, get the source tree.
-
Parameters:
-
inputSource
|
pointer to input source
|
-
Returns:
-
source tree
Reimplemented in XSLTEngineImpl.
const StylesheetRoot * XSLTProcessor::getStylesheetRoot () const [pure virtual] |
|
Retrieve the root stylesheet.
-
Returns:
-
pointer to root stylesheet
Reimplemented in XSLTEngineImpl.
unsigned long XSLTProcessor::getTraceListeners () const [pure virtual] |
|
Determine the number of trace listeners.
-
Returns:
-
number of listeners
Reimplemented in XSLTEngineImpl.
bool XSLTProcessor::getTraceSelects () const [pure virtual] |
|
If this is set to true, simple traces of template calls are made.
-
Returns:
-
true if traces made
Reimplemented in XSLTEngineImpl.
const XalanDOMString XSLTProcessor::getUniqueNSValue () const [pure virtual] |
|
Generate a random namespace prefix guaranteed to be unique.
-
Returns:
-
unique namespace prefix
Reimplemented in XSLTEngineImpl.
Get the XML Parser Liaison that this processor uses.
-
Returns:
-
XML parser liaison object
Reimplemented in XSLTEngineImpl.
Give the user a message.
-
Parameters:
-
msg
|
text of message to output
|
sourceNode
|
node in source where message occurred
|
styleNode
|
node in stylesheet where message occurred
|
Reimplemented in XSLTEngineImpl.
Output an object to the result tree by doing the right conversions.
This is public for access by extensions.
-
Parameters:
-
executionContext
|
current execution context
|
obj
|
the XObject to output
|
Reimplemented in XSLTEngineImpl.
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:
-
Reimplemented in XSLTEngineImpl.
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:
-
Reimplemented in XSLTEngineImpl.
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:
-
Reimplemented in XSLTEngineImpl.
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:
-
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::removeTraceListener (
|
TraceListener * tl) [pure virtual] |
|
Remove a trace listener.
-
Parameters:
-
tl
|
Trace listener to be removed.
|
Reimplemented in XSLTEngineImpl.
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.
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::resetCurrentState (
|
XalanNode * sourceTree, |
|
XalanNode * xmlNode) [pure virtual] |
|
Reset the state of execution to node 'xmlNode' in source tree 'sourceTree.'.
-
Parameters:
-
sourceTree
|
source tree for execution
|
xmlNode
|
node to execute
|
Reimplemented in XSLTEngineImpl.
Resolve the params that were pushed by the caller.
Reimplemented in XSLTEngineImpl.
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
|
Reimplemented in XSLTEngineImpl.
Set the execution context.
Must be set if after calling
setStylesheetRoot.
-
Parameters:
-
theExecutionContext
|
pointer to new execution context.
|
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::setFormatterListener (
|
FormatterListener * flistener) [pure virtual] |
|
Set the current formatter listener.
-
Parameters:
-
flistener
|
pointer to new formatter listener
|
Reimplemented in XSLTEngineImpl.
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.
|
Reimplemented in XSLTEngineImpl.
Push a top-level stylesheet parameter.
This value can be evaluated via
xsl:param-variable.
-
Parameters:
-
key
|
name of the param
|
expression
|
expression that will be evaluated
|
Reimplemented in XSLTEngineImpl.
Push a top-level stylesheet parameter.
This value can be evaluated via
xsl:param-variable.
-
Parameters:
-
key
|
name of the parameter
|
value
|
XObject value for parameter
|
Reimplemented in XSLTEngineImpl.
void XSLTProcessor::setStylesheetRoot (
|
const StylesheetRoot * theStylesheet) [pure virtual] |
|
Set the root stylesheet.
-
Parameters:
-
theStylesheet
|
pointer to new root stylesheet
|
Reimplemented in XSLTEngineImpl.
Tells, through the combination of the default-space attribute on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the xml:space attribute, whether or not extra whitespace should be stripped from the node.
Literal elements from template elements should not be
tested with this function.
-
Parameters:
-
executionContext
|
current execution context
|
node
|
text node from the source tree
|
-
Returns:
-
true if the text node should be stripped of extra whitespace
$$$ ToDo: This has no business being here in the engine...
Reimplemented in XSLTEngineImpl.
Compose a diagnostic trace of the current selection.
-
Parameters:
-
theTemplate
|
current context node
|
nl
|
list of selected nodes
|
Reimplemented in XSLTEngineImpl.
Tell the user of an warning, and probably throw an exception.
-
Parameters:
-
msg
|
text of message to output
|
sourceNode
|
node in source where error occurred
|
styleNode
|
node in stylesheet where error occurred
|
-
Exceptions:
-
Reimplemented in XSLTEngineImpl.
The documentation for this class was generated from the following file:
Interpreting class diagrams
Doxygen and
GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSL Transformer Version 1.0
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.
|
|