Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XSLTEngineImpl Class Reference

It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison, 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. More...

#include <XSLTEngineImpl.hpp>

Inheritance diagram for XSLTEngineImpl:

Inheritance graph
[legend]
Collaboration diagram for XSLTEngineImpl:

Collaboration graph
[legend]
List of all members.

Public Types

Public Methods

Static Public Methods

Protected Methods

Protected Attributes


Detailed Description

It's the responsibility of the XSLTEngineImpl class, collaborating with the XML parser liaison, 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 process method is the primary public entry points.

If you reuse the processor instance, you should call reset() between calls.


Member Typedef Documentation

typedef XalanVector< bool > XSLTEngineImpl::BoolVectorType<bool>
 

typedef XPathConstructionContext::GetAndReleaseCachedString XSLTEngineImpl::CCGetAndReleaseCachedString
 

typedef XPathExecutionContext::GetAndReleaseCachedString XSLTEngineImpl::ECGetAndReleaseCachedString
 

typedef XalanVector< const LocatorType *> XSLTEngineImpl::LocatorStack<const LocatorType*>
 

typedef StylesheetExecutionContext::ParamVectorType XSLTEngineImpl::ParamVectorType
 

typedef XalanVector< TraceListener *> XSLTEngineImpl::TraceListenerVectorType<TraceListener*>
 

typedef Function::XObjectArgVectorType XSLTEngineImpl::XObjectArgVectorType
 

typedef XalanMemMgrAutoPtr< XPathProcessor, true > XSLTEngineImpl::XPathProcessorPtrType<XPathProcessor, true>
 

typedef XalanVector< const XalanDOMString *> XSLTEngineImpl::XalanDOMStringPointerVectorType<const XalanDOMString*>
 


Constructor & Destructor Documentation

XSLTEngineImpl::XSLTEngineImpl ( MemoryManagerType & theManager,
XMLParserLiaison & parserLiaison,
XPathEnvSupport & xpathEnvSupport,
DOMSupport & domSupport,
XObjectFactory & xobjectFactory,
XPathFactory & xpathFactory )
 

Construct an XSL processor that can call back to a XML processor, so it can handle included files, and the like.

You must create a new instance of the XSLTEngineImpl class each time you run a transformation.

Parameters:
XMLParserLiaison   liaison to an object that can help with a specific parser implementation
xpathEnvSupport   An XPathEnvSupport instance
domSupport   A DOMSupport instance for the DOM being used
xobjectFactory   object responsible for XObject objects
xpathFactory   object responsible for XPath objects

XSLTEngineImpl::~XSLTEngineImpl ( ) [virtual]
 


Member Function Documentation

void XSLTEngineImpl::addResultAttribute ( const XalanDOMString & aname,
const XalanDOMString & value,
bool fromCopy = false,
const LocatorType * locator = 0 )
 

Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack.

Parameters:
aname   name of attribute
value   value of attribute
fromCopy   true if the attribute is being copied from the source tree
locator   The Locator for reporting errors.

void XSLTEngineImpl::addResultAttribute ( const XalanDOMString & aname,
const XalanDOMChar * value,
bool fromCopy = false,
const LocatorType * locator = 0 )
 

Add attribute to pending attributes list, and if it is a namespace, add it to the namespaces stack.

Parameters:
aname   name of attribute
value   value of attribute
fromCopy   true if the attribute is being copied from the source tree
locator   The Locator for reporting errors.

void XSLTEngineImpl::addResultAttribute ( AttributeListImpl & attList,
const XalanDOMString & aname,
const XalanDOMChar * value,
XalanDOMString::size_type theLength,
bool fromCopy = false,
const LocatorType * locator = 0 )
 

Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.

Parameters:
attList   attribute list added to
aname   name of attribute
value   value of attribute
theLength   The length of the value
fromCopy   true if the attribute is being copied from the source tree
locator   The Locator for reporting errors.

void XSLTEngineImpl::addResultAttribute ( AttributeListImpl & attList,
const XalanDOMString & aname,
const XalanDOMChar * value,
bool fromCopy = false,
const LocatorType * locator = 0 )
 

Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.

Parameters:
attList   attribute list added to
aname   name of attribute
value   value of attribute
fromCopy   true if the attribute is being copied from the source tree
locator   The Locator for reporting errors.

void XSLTEngineImpl::addResultAttribute ( AttributeListImpl & attList,
const XalanDOMString & aname,
const XalanDOMString & value,
bool fromCopy = false,
const LocatorType * locator = 0 )
 

Add attribute to attribute list, and if it is a namespace, add it to the namespaces stack.

Parameters:
attList   attribute list added to
aname   name of attribute
value   value of attribute
fromCopy   true if the attribute is being copied from the source tree
locator   The Locator for reporting errors.

void XSLTEngineImpl::addResultNamespaceDecl ( const XalanDOMString & prefix,
const XalanDOMChar * namespaceVal,
XalanDOMString::size_type len )
 

Add a namespace declaration to the namespace stack.

Parameters:
prefix   namespace prefix
namespaceVal   value of namespace
len   length of namespace

void XSLTEngineImpl::addResultNamespaceDecl ( const XalanDOMString & prefix,
const XalanDOMString & namespaceVal )
 

Add a namespace declaration to the namespace stack.

Parameters:
prefix   namespace prefix
namespaceVal   value of namespace

void XSLTEngineImpl::addTraceListener ( TraceListener * tl ) [virtual]
 

Add a trace listener for the purposes of debugging and diagnosis.

Parameters:
tl   pointer to listener to add

Reimplemented from XSLTProcessor.

void XSLTEngineImpl::cdata ( const XalanDOMChar * ch,
XalanDOMString::size_type start,
XalanDOMString::size_type length )
 

Receive notification of cdata.

Parameters:
ch   pointer to characters from the XML document
start   start position in the array
length   number of characters to read from the array

void XSLTEngineImpl::characters ( const XObjectPtr & xobject )
 

Send character data from an XObject to the result tree.

Parameters:
node   The xobject to send.

void XSLTEngineImpl::characters ( const XalanNode & node )
 

Send character data from the node to the result tree.

Parameters:
node   The node to send.

void XSLTEngineImpl::characters ( const XalanDOMChar * ch,
XalanDOMString::size_type start,
XalanDOMString::size_type length )
 

Receive notification of character data.

Parameters:
ch   pointer to characters from the XML document
start   startng offset in 'ch' array
length   number of characters to read from the array

void XSLTEngineImpl::characters ( const XalanDOMChar * ch,
XalanDOMString::size_type length )
 

void XSLTEngineImpl::charactersRaw ( const XObjectPtr & xobject )
 

Send raw character data from an XObject to the result tree.

Parameters:
node   The xobject to send.

void XSLTEngineImpl::charactersRaw ( const XalanNode & node )
 

Send raw character data from the node to the result tree.

Parameters:
node   The node to send.

void XSLTEngineImpl::charactersRaw ( const XalanDOMChar * ch,
XalanDOMString::size_type start,
XalanDOMString::size_type length )
 

Receive notification of character data.

If available, when the disable-output-escaping attribute is used, output raw text without escaping.

Parameters:
ch   pointer to characters from the XML document
start   start position in the array
length   number of characters to read from the array

void XSLTEngineImpl::clearTopLevelParams ( )
 

Reset the vector of top level parameters.

void XSLTEngineImpl::cloneToResultTree ( const XalanNode & node,
XalanNode::NodeType nodeType,
bool overrideStrip,
bool shouldCloneAttributes,
bool cloneTextNodesOnly,
const LocatorType * locator )
 

Clone a node to the result tree.

Parameters:
node   node to clone
nodeType   the type of the node
overrideStrip   false if white space stripping should be done
shouldCloneAttributes   true if attributes should be cloned
cloneTextNodesOnly   if true, only text nodes will be cloned
locator   the Locator for the event, if any.

void XSLTEngineImpl::cloneToResultTree ( const XalanNode & node,
bool cloneTextNodesOnly,
const LocatorType * locator )
 

Clone a node to the result tree.

Parameters:
node   node to clone
cloneTextNodesOnly   if true, only text nodes will be cloned
locator   the Locator for the event, if any.

void XSLTEngineImpl::comment ( const XalanDOMChar * data )
 

Called when a Comment is to be constructed.

Parameters:
data   pointer to comment data

void XSLTEngineImpl::copyAttributeToTarget ( const XalanDOMString & attrName,
const XalanDOMString & attrValue,
AttributeListImpl & attrList )
 

Copy an attribute to an AttributeListImpl.

Parameters:
attrName   The name of the attribute
attrValue   The value of the attribute
attrList   The attribute list added to

void XSLTEngineImpl::copyAttributesToAttList ( const XalanNode & node,
AttributeListImpl & attList ) [protected]
 

Copy the attributes from the XSL element to the created output element.

void XSLTEngineImpl::copyNamespaceAttributes ( const XalanNode & src )
 

Copy XMLNS: attributes in if not already in scope.

Parameters:
src   source node

const XPath * XSLTEngineImpl::createMatchPattern ( const XalanDOMString & str,
const PrefixResolver & resolver )
 

Create and initialize an xpath and return it.

Parameters:
str   string for XPath
resolver   resolver for namespace resolution
Returns:
pointer to XPath created

void XSLTEngineImpl::endDocument ( )
 

void XSLTEngineImpl::endElement ( const XalanDOMChar * name )
 

void XSLTEngineImpl::entityReference ( const XalanDOMChar * data )
 

Receive notification of a entityReference.

Parameters:
data   pointer to characters from the XML document
Exceptions:
SAXException  

void XSLTEngineImpl::error ( const XalanDOMString & msg,
const LocatorType & locator,
const XalanNode * sourceNode = 0 ) const [virtual]
 

Report an error and throw an exception.

Parameters:
msg   text of message to output
locator   A LocatorType for error reporting
sourceNode   node in source where error occurred

Reimplemented from XSLTProcessor.

void XSLTEngineImpl::error ( const XalanDOMString & msg,
const XalanNode * sourceNode = 0,
const ElemTemplateElement * styleNode = 0 ) const [virtual]
 

Report an error and throw an exception.

Parameters:
msg   text of message to output
sourceNode   node in source where error occurred
styleNode   node in stylesheet where error occurred

Reimplemented from XSLTProcessor.

double XSLTEngineImpl::evalMatchPatternStr ( const XalanDOMString & str,
XalanNode * context,
XPathExecutionContext & executionContext )
 

Evaluate an xpath string and return the result as a numberic score.

Parameters:
str   string to evaluate
context   context node
executionContext   current execution context
Returns:
score number, higher representing better match

const XObjectPtr XSLTEngineImpl::evalXPathStr ( const XalanDOMString & str,
XalanNode * contextNode,
const XalanElement & prefixResolver,
XPathExecutionContext & executionContext )
 

Evaluate an xpath string and return the result.

Parameters:
str   string to evaluate
contextNode   context node
prefixResolver   prefix resolver to use
executionContext   current execution context
Returns:
pointer to XObject result

const XObjectPtr XSLTEngineImpl::evalXPathStr ( const XalanDOMString & str,
XalanNode * contextNode,
const PrefixResolver & prefixResolver,
XPathExecutionContext & executionContext )
 

Evaluate an xpath string and return the result.

Parameters:
str   string to evaluate
contextNode   context node
prefixResolver   prefix resolver to use
executionContext   current execution context
Returns:
pointer to XObject result

const XObjectPtr XSLTEngineImpl::evalXPathStr ( const XalanDOMString & str,
XPathExecutionContext & executionContext )
 

Evaluate an xpath string and return the result.

Parameters:
str   string to evaluate
executionContext   current execution context
Returns:
pointer to XObject result

void XSLTEngineImpl::fireGenerateEvent ( const GenerateEvent & ge ) [virtual]
 

Fire a generate event.

Parameters:
ge   generate event to fire

Reimplemented from XSLTProcessor.

void XSLTEngineImpl::fireSelectEvent ( const SelectionEvent & se ) [virtual]
 

Fire a selection event.

Parameters:
se   selection event to fire

Reimplemented from XSLTProcessor.

void XSLTEngineImpl::fireTraceEvent ( const TracerEvent & te ) [virtual]
 

Fire a trace event.

Parameters:
te   trace event to fire

Reimplemented from XSLTProcessor.

void XSLTEngineImpl::flushPending ( )
 

Flush the pending element.

FormatterListener * XSLTEngineImpl::getFormatterListener ( ) const [virtual]
 

Get the current formatter listener.

Returns:
pointer to formatter listener

Reimplemented from XSLTProcessor.

FormatterListener * XSLTEngineImpl::getFormatterListenerImpl ( ) const [protected]
 

bool XSLTEngineImpl::getHasPendingStartDocument ( ) const
 

bool XSLTEngineImpl::getHasPendingStartDocumentImpl ( ) const [protected]
 

const LocatorType * XSLTEngineImpl::getLocatorFromStack ( ) const
 

Get the locator from the top of the locator stack.

Returns:
A pointer to the Locator, or 0 if there is nothing on the stack.

MemoryManagerType & XSLTEngineImpl::getMemoryManager ( )
 

bool XSLTEngineImpl::getMustFlushPendingStartDocument ( ) const
 

bool XSLTEngineImpl::getMustFlushPendingStartDocumentImpl ( ) const [protected]
 

const XalanDOMString * XSLTEngineImpl::getNamespaceForPrefix ( const XalanDOMString & prefix ) const [virtual]
 

Retrieve a namespace corresponding to a prefix.

This assumes that the PrevixResolver hold's its own namespace context, or is a namespace context itself.

Parameters:
prefix   Prefix to resolve
Returns:
namespace that prefix resolves to, or null if prefix is not found

Reimplemented from PrefixResolver.

const AttributeListType & XSLTEngineImpl::getPendingAttributes ( ) const
 

Get the list of attributes yet to be processed.

Returns:
attribute list

AttributeListImpl & XSLTEngineImpl::getPendingAttributesImpl ( ) [protected]
 

Get the list of attributes yet to be processed.

Returns:
attribute list

const AttributeListImpl & XSLTEngineImpl::getPendingAttributesImpl ( ) const [protected]
 

Get the list of attributes yet to be processed.

Returns:
attribute list

const XalanDOMString & XSLTEngineImpl::getPendingElementName ( ) const
 

Retrieve name of the pending element currently being processed.

Returns:
element name

XalanDOMString & XSLTEngineImpl::getPendingElementNameImpl ( ) [protected]
 

Retrieve name of the pending element currently being processed.

Returns:
element name

const XalanDOMString & XSLTEngineImpl::getPendingElementNameImpl ( ) const [protected]
 

Retrieve name of the pending element currently being processed.

Returns:
element name

ProblemListener * XSLTEngineImpl::getProblemListener ( ) const
 

Get the problem listener property.

The XSL class can have a single listener that can be informed of errors and warnings, and can normally control if an exception is thrown or not (or the problem listeners can throw their own RuntimeExceptions).

Returns:
pointer to ProblemListener interface

bool XSLTEngineImpl::getQuietConflictWarnings ( ) const
 

Whether to warn about pattern match conflicts.

Returns:
true to not warn about pattern match conflicts

const XalanDOMString * XSLTEngineImpl::getResultNamespaceForPrefix ( const XalanDOMString & prefix ) const
 

Retrieve the result namespace corresponding to a prefix.

Parameters:
prefix   prefix for namespace
Returns:
string for namespace URI

const XalanDOMString * XSLTEngineImpl::getResultPrefixForNamespace ( const XalanDOMString & theNamespace ) const
 

Retrieve the result prefix corresponding to a namespace.

Parameters:
theNamespace   namespace for prefix
Returns:
string for namespace prefix

XalanNode * XSLTEngineImpl::getSourceTreeFromInput ( const XSLTInputSource & inputSource ) [virtual]
 

Given an input source, get the source tree.

Parameters:
inputSource   pointer to input source
Returns:
source tree

Reimplemented from XSLTProcessor.

Stylesheet * XSLTEngineImpl::getStylesheetFromPIURL ( const XalanDOMString & xslURLString,
XalanNode & fragBase,
const XalanDOMString & xmlBaseIdent,
bool isRoot,
StylesheetConstructionContext & constructionContext )
 

Reset the state of the XSL processor by reading in a new XSL stylesheet from a processing instruction.

Parameters:
xslURLString   valid URI to an XSL stylesheet
fragBase   base of tree if URI represents document fragment
xmlBaseIdent   base identifier for stylesheet URI
isRoot   true if stylesheet is root of tree
constructionContext   context for construction of object
Returns:
pointer to stylesheet

const StylesheetRoot * XSLTEngineImpl::getStylesheetRoot ( ) const [virtual]
 

Retrieve the root stylesheet.

Returns:
pointer to root stylesheet

Reimplemented from XSLTProcessor.

size_type XSLTEngineImpl::getTraceListeners ( ) const [virtual]
 

Determine the number of trace listeners.

Returns:
number of listeners

Reimplemented from XSLTProcessor.

bool XSLTEngineImpl::getTraceSelects ( ) const [virtual]
 

If this is set to true, simple traces of template calls are made.

Returns:
true if traces made

Reimplemented from XSLTProcessor.

const XalanDOMString & XSLTEngineImpl::getURI ( ) const [virtual]
 

Retrieve the base URI for the resolver.

Returns:
URI string

Reimplemented from PrefixResolver.

void XSLTEngineImpl::getUniqueNamespaceValue ( XalanDOMString & theValue ) [virtual]
 

Generate a random namespace prefix guaranteed to be unique.

Parameters:
theValue   A string for returning the new prefix

Reimplemented from XSLTProcessor.

XMLParserLiaison & XSLTEngineImpl::getXMLParserLiaison ( ) const [virtual]
 

Get the XML Parser Liaison that this processor uses.

Returns:
XML parser liaison object

Reimplemented from XSLTProcessor.

XPathEnvSupport & XSLTEngineImpl::getXPathEnvSupport ( )
 

Retrieve the XPath environment support object.

Returns:
XPath environment support object

XPathFactory & XSLTEngineImpl::getXPathFactory ( )
 

Get the factory for making xpaths.

Returns:
XPath factory object

XPathProcessor & XSLTEngineImpl::getXPathProcessor ( )