Xalan-C++ API Reference  1.12.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
xalanc::XalanTransformer Class Reference

This is a simple C++ interface for some common usage patterns. More...

#include <xalanc/XalanTransformer/XalanTransformer.hpp>

Classes

class  EnsureDestroyCompiledStylesheet
 
struct  EnsureDestroyDocumentBuilder
 
class  EnsureDestroyParsedSource
 
class  EnsureFunctionsInstallation
 

Public Types

enum  eEscapeURLs { eEscapeURLsDefault, eEscapeURLsNo, eEscapeURLsYes }
 Enums to determine whether or not run-time escaping of URLs has been set. More...
 
enum  eOmitMETATag { eOmitMETATagDefault, eOmitMETATagNo, eOmitMETATagYes }
 Enums to determine whether or not run-time omission of the META tag has been set. More...
 
typedef std::ostream StreamType
 
typedef XalanVector< const XalanCompiledStylesheet * > CompiledStylesheetPtrVectorType
 
typedef XalanVector< const XalanParsedSource * > ParsedSourcePtrVectorType
 
typedef XalanMap< XalanDOMString, XalanParamHolderParamMapType
 
typedef XalanMap< XalanQNameByValue, Function * > FunctionMapType
 
typedef XalanVector< TraceListener * > TraceListenerVectorType
 

Public Member Functions

 XalanTransformer (MemoryManager &theManager=XalanMemMgrs::getDefaultXercesMemMgr())
 
virtual ~XalanTransformer ()
 
MemoryManager & getMemoryManager ()
 
const MemoryManager & getMemoryManager () const
 
int transform (const XalanParsedSource &theParsedXML, const XSLTInputSource &theStylesheetSource, const XSLTResultTarget &theResultTarget)
 Transform will apply the stylesheet source to the parsed xml source and write the transformation output to the target. More...
 
int transform (const XalanParsedSource &theParsedXML, const XalanCompiledStylesheet *theCompiledStylesheet, const XSLTResultTarget &theResultTarget)
 Transform will apply the compiled stylesheet to the parsed xml source and write the transformation output to the target. More...
 
int transform (const XalanParsedSource &theParsedXML, const XSLTResultTarget &theResultTarget)
 Transform will apply the stylesheet provided as a PI in the XML of the parsed xml source and write the transformation output to the target. More...
 
int transform (const XSLTInputSource &theInputSource, const XSLTInputSource &theStylesheetSource, const XSLTResultTarget &theResultTarget)
 Transform will apply the stylesheet source to the input source and write the transformation output to the target. More...
 
int transform (const XSLTInputSource &theInputSource, const XSLTResultTarget &theResultTarget)
 Transform will apply the stylesheet provided as a PI in the XML of the input source and write the transformation output to the target. More...
 
int transform (const XSLTInputSource &theInputSource, const XSLTInputSource &theStylesheetSource, void *theOutputHandle, XalanOutputHandlerType theOutputHandler, XalanFlushHandlerType theFlushHandler=0)
 Transform will apply the stylesheet source to the input source and write the transformation result to a callback function
in pre-allocated blocks. More...
 
int transform (const XSLTInputSource &theInputSource, const XalanCompiledStylesheet *theCompiledStylesheet, const XSLTResultTarget &theResultTarget)
 Transform will apply the compiled stylesheet to the input source and write the transformation output to the target. More...
 
int transform (const XalanParsedSource &theParsedSource, const XalanCompiledStylesheet *theCompiledStylesheet, void *theOutputHandle, XalanOutputHandlerType theOutputHandler, XalanFlushHandlerType theFlushHandler=0)
 Transform will apply the compiled stylesheet to the source and write the transformation result to a callback function
in pre-allocated blocks. More...
 
int transform (const XSLTInputSource &theInputSource, void *theOutputHandle, XalanOutputHandlerType theOutputHandler, XalanFlushHandlerType theFlushHandler=0)
 Transform will apply the stylesheet provided as a PI in the XML of the input source and write the transformation result to a
callback function in pre-allocated blocks. More...
 
int compileStylesheet (const XSLTInputSource &theStylesheetSource, const XalanCompiledStylesheet *&theCompiledStylesheet)
 Creates a compiled stylesheet. More...
 
int destroyStylesheet (const XalanCompiledStylesheet *theStylesheet)
 Destroy a XalanCompiledStylesheet instance created by a previous call to compileStylesheet(). More...
 
int parseSource (const XSLTInputSource &theInputSource, const XalanParsedSource *&theParsedSource, bool useXercesDOM=false)
 Parse a source XML document. More...
 
int destroyParsedSource (const XalanParsedSource *theParsedSource)
 Destroy a parsed source created by a previous call to parseSource(). More...
 
XalanDocumentBuildercreateDocumentBuilder (const XalanDOMString &theURI=XalanDOMString(XalanMemMgrs::getDummyMemMgr()))
 Create a document builder. More...
 
void destroyDocumentBuilder (XalanDocumentBuilder *theDocumentBuilder)
 Destroy a document builder created by a previous call to createDocumentBuilder(). More...
 
void installExternalFunction (const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function &function)
 Install an external function in the local space. More...
 
void uninstallExternalFunction (const XalanDOMString &theNamespace, const XalanDOMString &functionName)
 Uninstall an external local function. More...
 
XObjectFactorygetXObjectFactory () const
 Retrieve the factory object for creating XObjects. More...
 
void setStylesheetParam (const XalanDOMString &key, const XalanDOMString &expression)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const char *key, const char *expression)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const char *key, double number)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const XalanDOMString &key, double number)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const char *key, XalanNode *nodeset)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const XalanDOMString &key, XalanNode *nodeset)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const char *key, XObjectPtr object)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void setStylesheetParam (const XalanDOMString &key, XObjectPtr object)
 Set a top-level parameter, which the stylesheet can access with a top-level xsl:param. More...
 
void clearStylesheetParams ()
 Clear any stylesheet params. More...
 
void addTraceListener (TraceListener *theTraceListener)
 Add a TraceListener instance. More...
 
bool removeTraceListener (TraceListener *theTraceListener)
 Remove a TraceListener instance. More...
 
void removeTraceListeners ()
 Remove all TraceListener instances. More...
 
bool getUseValidation () const
 Set a flag to indicate whether or not the source file(s) for the transformation will be validated. More...
 
void setUseValidation (bool fValue)
 Set a flag to indicate whether or not the source file(s) for the transformation will be validated. More...
 
EntityResolver * getEntityResolver () const
 Returns the installed EntityResolver. More...
 
void setEntityResolver (EntityResolver *theResolver)
 Installs the supplied EntityResolver. More...
 
XMLEntityResolver * getXMLEntityResolver () const
 Returns the installed XMLEntityResolver. More...
 
void setXMLEntityResolver (XMLEntityResolver *theResolver)
 Installs the supplied XMLEntityResolver. More...
 
ErrorHandler * getErrorHandler () const
 This method returns the installed error handler. More...
 
void setErrorHandler (ErrorHandler *theErrorHandler)
 This method installs the user-specified error handler. More...
 
const XalanDOMChar * getExternalSchemaLocation () const
 This method returns the location for an external schema document for parsing. More...
 
void setExternalSchemaLocation (const XalanDOMChar *location)
 This method sets the location for an external schema document for parsing. More...
 
const XalanDOMChar * getExternalNoNamespaceSchemaLocation () const
 This method returns the location for an external schema document for parsing. More...
 
void setExternalNoNamespaceSchemaLocation (const XalanDOMChar *location)
 This method sets the location for an external schema document for parsing. More...
 
bool getPoolAllTextNodes () const
 This member functions gets the flag to determine of a default parsed source tree will pool the values of all of the text nodes in the XML document. More...
 
void setPoolAllTextNodes (bool fPool)
 This member functions sets the flag to determine of a default parsed source tree will pool the values of all of the text nodes in the XML document. More...
 
ProblemListenergetProblemListener () const
 This method returns the installed ProblemListener instance. More...
 
void setProblemListener (ProblemListener *theProblemListener)
 This method installs the user-specified ProblemListener instance. More...
 
const char * getLastError () const
 Returns the last error that occurred as a result of calling transform. More...
 
const XalanDOMStringgetOutputEncoding () const
 Get the current output encoding, if any. More...
 
void setOutputEncoding (const XalanDOMString &theEncoding)
 Set the current output encoding. More...
 
int getIndent () const
 Get the current number of spaces to indent. More...
 
void setIndent (int indentAmount)
 Set the current number of spaces to indent. More...
 
eEscapeURLs getEscapeURLs () const
 Get the value for run-time escaping of URLs. More...
 
void setEscapeURLs (eEscapeURLs value)
 Set the value for run-time escaping of URLs. More...
 
eOmitMETATag getOmitMETATag () const
 Get the value for run-time omission of the META tag. More...
 
void setOmitMETATag (eOmitMETATag value)
 Get the value for run-time omission of the META tag. More...
 
void setErrorStream (StreamType *theStream)
 Set the ostream instance for reporting errors. More...
 
StreamTypegetErrorStream () const
 Get the current error stream ostream instance. More...
 
void setWarningStream (StreamType *theStream)
 Set the ostream instance for reporting warnings and messages. More...
 
StreamTypegetWarningStream () const
 Get the current warning stream ostream instance. More...
 
bool getICUAvailable () const
 

Static Public Member Functions

static void initialize (MemoryManager &theManager=XalanMemMgrs::getDefaultXercesMemMgr())
 Initialize Xalan. More...
 
static void terminate ()
 Terminate Xalan. More...
 
static void ICUCleanUp ()
 Clean up the ICU, if ICU integration is enabled. More...
 
static void ICUStartUp (MemoryManager &theManager=XalanMemMgrs::getDefaultXercesMemMgr())
 
static void installExternalFunctionGlobal (const XalanDOMString &theNamespace, const XalanDOMString &functionName, const Function &function)
 Install an external function in the global space. More...
 
static void uninstallExternalFunctionGlobal (const XalanDOMString &theNamespace, const XalanDOMString &functionName)
 Uninstall an external global function. More...
 

Friends

class EnsureReset
 

Detailed Description

This is a simple C++ interface for some common usage patterns.

It's the user's responsibility to call initialize and terminate for Xerces and Xalan before creating and after deleting any XalanTransformer
instances.

Definition at line 90 of file XalanTransformer.hpp.

Member Typedef Documentation

◆ CompiledStylesheetPtrVectorType

Definition at line 97 of file XalanTransformer.hpp.

◆ FunctionMapType

Definition at line 102 of file XalanTransformer.hpp.

◆ ParamMapType

Definition at line 100 of file XalanTransformer.hpp.

◆ ParsedSourcePtrVectorType

Definition at line 98 of file XalanTransformer.hpp.

◆ StreamType

Definition at line 95 of file XalanTransformer.hpp.

◆ TraceListenerVectorType

Definition at line 103 of file XalanTransformer.hpp.

Member Enumeration Documentation

◆ eEscapeURLs

Enums to determine whether or not run-time escaping of URLs has been set.

Enumerator
eEscapeURLsDefault 
eEscapeURLsNo 
eEscapeURLsYes 

Definition at line 912 of file XalanTransformer.hpp.

◆ eOmitMETATag

Enums to determine whether or not run-time omission of the META tag has been set.

Relevant only for HTML output

Enumerator
eOmitMETATagDefault 
eOmitMETATagNo 
eOmitMETATagYes 

Definition at line 943 of file XalanTransformer.hpp.

Constructor & Destructor Documentation

◆ XalanTransformer()

xalanc::XalanTransformer::XalanTransformer ( MemoryManager &  theManager = XalanMemMgrs::getDefaultXercesMemMgr())

◆ ~XalanTransformer()

virtual xalanc::XalanTransformer::~XalanTransformer ( )
virtual

Member Function Documentation

◆ addTraceListener()

void xalanc::XalanTransformer::addTraceListener ( TraceListener theTraceListener)
inline

Add a TraceListener instance.

TraceListeners instances are preserved between calls to transform(), so they will be called until they are removed.

Parameters
theTraceListenerThe instance to add.

Definition at line 624 of file XalanTransformer.hpp.

◆ clearStylesheetParams()

void xalanc::XalanTransformer::clearStylesheetParams ( )
inline

Clear any stylesheet params.

Definition at line 610 of file XalanTransformer.hpp.

◆ compileStylesheet()

int xalanc::XalanTransformer::compileStylesheet ( const XSLTInputSource theStylesheetSource,
const XalanCompiledStylesheet *&  theCompiledStylesheet 
)

Creates a compiled stylesheet.

The input source can be a file name, a stream or a root node. The XalanTransformer instance owns the XalanCompiledStylesheet instance and will delete it when the XalanTransformer instance goes out of scope, or you explicitly call destroyStylesheet(). You must not delete the instance yourself.

Parameters
theStylesheetSourceinput source
theCompiledStylesheeta reference to a pointer to a XalanCompileStylesheet.
Returns
0 for success

◆ createDocumentBuilder()

XalanDocumentBuilder* xalanc::XalanTransformer::createDocumentBuilder ( const XalanDOMString theURI = XalanDOMString(XalanMemMgrs::getDummyMemMgr()))

Create a document builder.

Using the document builder, you can construct a document using SAX2 interfaces. The XalanTransformer instance owns the document builder and will delete it when the XalanTransformer instance goes out of scope, or you explicitly call destroyDocumentBuilder(). You must not delete the instance yourself.

Parameters
theURIThe base URI for the document instance.
Returns
a pointer to a XalanDocumentBuilder instance or 0 for failure.

◆ destroyDocumentBuilder()

void xalanc::XalanTransformer::destroyDocumentBuilder ( XalanDocumentBuilder theDocumentBuilder)

Destroy a document builder created by a previous call to createDocumentBuilder().

Passing a pointer that is not created by a call to createDocumentBuilder() can result in undefined behavior.

Parameters
theDocumentBuilderThe document builder to destroy.

◆ destroyParsedSource()

int xalanc::XalanTransformer::destroyParsedSource ( const XalanParsedSource theParsedSource)

Destroy a parsed source created by a previous call to parseSource().

Parameters
theParsedSourceThe XalanParsedSource instance to destroy.
Returns
0 for success

◆ destroyStylesheet()

int xalanc::XalanTransformer::destroyStylesheet ( const XalanCompiledStylesheet theStylesheet)

Destroy a XalanCompiledStylesheet instance created by a previous call to compileStylesheet().

Parameters
theStylesheetThe instance to destroy.
Returns
0 for success

◆ getEntityResolver()

EntityResolver* xalanc::XalanTransformer::getEntityResolver ( ) const
inline

Returns the installed EntityResolver.

Returns
The pointer to the installed EntityResolver.

Definition at line 677 of file XalanTransformer.hpp.

◆ getErrorHandler()

ErrorHandler* xalanc::XalanTransformer::getErrorHandler ( ) const
inline

This method returns the installed error handler.

Returns
The pointer to the installed error handler object.

Definition at line 737 of file XalanTransformer.hpp.

◆ getErrorStream()

StreamType* xalanc::XalanTransformer::getErrorStream ( ) const
inline

Get the current error stream ostream instance.

Returns
A pointer to the instance. Can be a null pointer.

Definition at line 991 of file XalanTransformer.hpp.

◆ getEscapeURLs()

eEscapeURLs xalanc::XalanTransformer::getEscapeURLs ( ) const

Get the value for run-time escaping of URLs.

This can override the property specified by the stylesheet. The default behavior is to honor the property in the stylesheet.

Returns
The value of the enum

◆ getExternalNoNamespaceSchemaLocation()

const XalanDOMChar* xalanc::XalanTransformer::getExternalNoNamespaceSchemaLocation ( ) const
inline

This method returns the location for an external schema document for parsing.

Returns
A string representing the location of the external schema document

Definition at line 786 of file XalanTransformer.hpp.

◆ getExternalSchemaLocation()

const XalanDOMChar* xalanc::XalanTransformer::getExternalSchemaLocation ( ) const
inline

This method returns the location for an external schema document for parsing.

Returns
A string representing the location of the external schema document

Definition at line 760 of file XalanTransformer.hpp.

◆ getICUAvailable()

bool xalanc::XalanTransformer::getICUAvailable ( ) const

◆ getIndent()

int xalanc::XalanTransformer::getIndent ( ) const

Get the current number of spaces to indent.

Returns
number of spaces

◆ getLastError()

const char* xalanc::XalanTransformer::getLastError ( ) const
inline

Returns the last error that occurred as a result of calling transform.

Returns
error message const character pointer.

Definition at line 860 of file XalanTransformer.hpp.

◆ getMemoryManager() [1/2]

MemoryManager& xalanc::XalanTransformer::getMemoryManager ( )
inline

Definition at line 111 of file XalanTransformer.hpp.

◆ getMemoryManager() [2/2]

const MemoryManager& xalanc::XalanTransformer::getMemoryManager ( ) const
inline

Definition at line 117 of file XalanTransformer.hpp.

◆ getOmitMETATag()

eOmitMETATag xalanc::XalanTransformer::getOmitMETATag ( ) const

Get the value for run-time omission of the META tag.

This can override the property specified by the stylesheet. The default behavior is to honor the property in the stylesheet.

Returns
The value of the enum

◆ getOutputEncoding()

const XalanDOMString& xalanc::XalanTransformer::getOutputEncoding ( ) const
inline

Get the current output encoding, if any.

Note this is not the output encoding specified in a stylesheet. Rather, it can override that encoding, if the

Returns
A string containing the current encoding

Definition at line 874 of file XalanTransformer.hpp.

◆ getPoolAllTextNodes()

bool xalanc::XalanTransformer::getPoolAllTextNodes ( ) const
inline

This member functions gets the flag to determine of a default parsed source tree will pool the values of all of the text nodes in the XML document.

Returns
The boolean value for the flag.

Definition at line 812 of file XalanTransformer.hpp.

◆ getProblemListener()

ProblemListener* xalanc::XalanTransformer::getProblemListener ( ) const
inline

This method returns the installed ProblemListener instance.

Returns
The pointer to the installed ProblemListener instance.

Definition at line 837 of file XalanTransformer.hpp.

◆ getUseValidation()

bool xalanc::XalanTransformer::getUseValidation ( ) const
inline

Set a flag to indicate whether or not the source file(s) for the transformation will be validated.

Parameters
fValuethe new value for the flag.

Definition at line 654 of file XalanTransformer.hpp.

◆ getWarningStream()

StreamType* xalanc::XalanTransformer::getWarningStream ( ) const
inline

Get the current warning stream ostream instance.

Returns
A pointer to the instance. Can be a null pointer.

Definition at line 1016 of file XalanTransformer.hpp.

◆ getXMLEntityResolver()

XMLEntityResolver* xalanc::XalanTransformer::getXMLEntityResolver ( ) const
inline

Returns the installed XMLEntityResolver.

Returns
The pointer to the installed XMLEntityResolver.

Definition at line 707 of file XalanTransformer.hpp.

◆ getXObjectFactory()

XObjectFactory& xalanc::XalanTransformer::getXObjectFactory ( ) const
inline

Retrieve the factory object for creating XObjects.

Returns
factory object instance

Definition at line 495 of file XalanTransformer.hpp.

◆ ICUCleanUp()

static void xalanc::XalanTransformer::ICUCleanUp ( )
static

Clean up the ICU, if ICU integration is enabled.

This should be called only once per process after calling XalanTransformer::terminate() and XMLPlatformUtils::Terminate.

This must only be done if the ICU will no longer be used by the process, since the ICU will no longer be in a usable state. See the ICU documentation for more details.

This call is not thread-safe, so you must serialize any calls to it, and you must track the initialization state, so you do not call it more than once.

This is handy when using leak-detection software, as all static data allocated by the ICU is freed.

◆ ICUStartUp()

static void xalanc::XalanTransformer::ICUStartUp ( MemoryManager &  theManager = XalanMemMgrs::getDefaultXercesMemMgr())
static

◆ initialize()

static void xalanc::XalanTransformer::initialize ( MemoryManager &  theManager = XalanMemMgrs::getDefaultXercesMemMgr())
static

Initialize Xalan.

Should be called only once per process before creating any instances of XalanTransformer. This call is not thread-safe, so you must serialize any calls to it, and you must track the initialization state, so you do not call it more than once.

◆ installExternalFunction()

void xalanc::XalanTransformer::installExternalFunction ( const XalanDOMString theNamespace,
const XalanDOMString functionName,
const Function function 
)

Install an external function in the local space.

Parameters
theNamespaceThe namespace for the functionl
functionNameThe name of the function.
functionThe function to install.

◆ installExternalFunctionGlobal()

static void xalanc::XalanTransformer::installExternalFunctionGlobal ( const XalanDOMString theNamespace,
const XalanDOMString functionName,
const Function function 
)
static

Install an external function in the global space.

Parameters
theNamespaceThe namespace for the functionl
functionNameThe name of the function.
functionThe function to install.

◆ parseSource()

int xalanc::XalanTransformer::parseSource ( const XSLTInputSource theInputSource,
const XalanParsedSource *&  theParsedSource,
bool  useXercesDOM = false 
)

Parse a source XML document.

The input source can be a file name, a stream or a root node. The XalanTransformer instance owns the XalanParsedSource instance and will delete it when the XalanTransformer instance goes out of scope, or you explicitly call destroyParsedSource(). You must not delete the instance yourself.

Parameters
theInputSourceinput source
theParsedSourcea reference to a pointer to a XalanParsedSource.
useXercesDOMinput use default or xerces DOM source tree
Returns
0 for success

◆ removeTraceListener()

bool xalanc::XalanTransformer::removeTraceListener ( TraceListener theTraceListener)

Remove a TraceListener instance.

Parameters
theTraceListenerThe instance to remove.
Returns
true if the instance was removed, false if not.

◆ removeTraceListeners()

void xalanc::XalanTransformer::removeTraceListeners ( )
inline

Remove all TraceListener instances.

Definition at line 642 of file XalanTransformer.hpp.

◆ setEntityResolver()

void xalanc::XalanTransformer::setEntityResolver ( EntityResolver *  theResolver)
inline

Installs the supplied EntityResolver.

A call to setEntityResolver with a non-null pointer will uninstall any XMLEntityResolver previously installed.

Parameters
theResolverA pointer to the EntityResolver.

Definition at line 691 of file XalanTransformer.hpp.

◆ setErrorHandler()

void xalanc::XalanTransformer::setErrorHandler ( ErrorHandler *  theErrorHandler)
inline

This method installs the user-specified error handler.

Parameters
handlerA pointer to the error handler to be called upon error.

Definition at line 748 of file XalanTransformer.hpp.

◆ setErrorStream()

void xalanc::XalanTransformer::setErrorStream ( StreamType theStream)
inline

Set the ostream instance for reporting errors.

The default is a null pointer, so errors are not reported. If there is a user-installed ProblemListener instance, this is not used, as all such warnings and messages are handled by the that ProblemListener.

Parameters
theStreamA pointer to the ostream instance.

Definition at line 980 of file XalanTransformer.hpp.

◆ setEscapeURLs()

void xalanc::XalanTransformer::setEscapeURLs ( eEscapeURLs  value)

Set the value for run-time escaping of URLs.

This can override the property specified by the stylesheet. The default behavior is to honor the property in the stylesheet.

Parameters
valueThe value of the enum

◆ setExternalNoNamespaceSchemaLocation()

void xalanc::XalanTransformer::setExternalNoNamespaceSchemaLocation ( const XalanDOMChar *  location)
inline

This method sets the location for an external schema document for parsing.

Parameters
locationA string representing the location of the external schema document

Definition at line 798 of file XalanTransformer.hpp.

◆ setExternalSchemaLocation()

void xalanc::XalanTransformer::setExternalSchemaLocation ( const XalanDOMChar *  location)
inline

This method sets the location for an external schema document for parsing.

Parameters
locationA string representing the location of the external schema document

Definition at line 772 of file XalanTransformer.hpp.

◆ setIndent()

void xalanc::XalanTransformer::setIndent ( int  indentAmount)

Set the current number of spaces to indent.

Parameters
indentAmountThe number of spaces to indent. Use -1 for the default amount.

◆ setOmitMETATag()

void xalanc::XalanTransformer::setOmitMETATag ( eOmitMETATag  value)

Get the value for run-time omission of the META tag.

This can override the property specified by the stylesheet. The default behavior is to honor the property in the stylesheet.

Parameters
valueThe value of the enum

◆ setOutputEncoding()

void xalanc::XalanTransformer::setOutputEncoding ( const XalanDOMString theEncoding)
inline

Set the current output encoding.

Note this will override the encoding specified in the stylesheet, if the encoding is available. However, it will not override any encoding specified by an XSLTResultTarget parameter to one of the transform() member functions.

Parameters
theEncodingThe encoding to use.

Definition at line 888 of file XalanTransformer.hpp.

◆ setPoolAllTextNodes()

void xalanc::XalanTransformer::setPoolAllTextNodes ( bool  fPool)
inline

This member functions sets the flag to determine of a default parsed source tree will pool the values of all of the text nodes in the XML document.

This can result in significant memory savings if there are lots of repeated values in text nodes.

Parameters
fPoolThe boolean value for the flag.

Definition at line 826 of file XalanTransformer.hpp.

◆ setProblemListener()

void xalanc::XalanTransformer::setProblemListener ( ProblemListener theProblemListener)
inline

This method installs the user-specified ProblemListener instance.

Parameters
handlerA pointer to the ProblemListener to be called when a problem occurs.

Definition at line 848 of file XalanTransformer.hpp.

◆ setStylesheetParam() [1/8]

void xalanc::XalanTransformer::setStylesheetParam ( const char *  key,
const char *  expression 
)

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
keyname of the param
expressionexpression that will be evaluated

◆ setStylesheetParam() [2/8]

void xalanc::XalanTransformer::setStylesheetParam ( const char *  key,
double  number 
)

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
keyname of the param
numbervalue to be evaluated

◆ setStylesheetParam() [3/8]

void xalanc::XalanTransformer::setStylesheetParam ( const char *  key,
XalanNode nodeset 
)

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
keyname of the param
nodesetXML nodeset that will be evaulated

◆ setStylesheetParam() [4/8]

void xalanc::XalanTransformer::setStylesheetParam ( const char *  key,
XObjectPtr  object 
)

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
keyname of the param
objectany XObject owned by the transformer

◆ setStylesheetParam() [5/8]

void xalanc::XalanTransformer::setStylesheetParam ( const XalanDOMString key,
const XalanDOMString expression 
)

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
keyname of the param
expressionexpression that will be evaluated

◆ setStylesheetParam() [6/8]

void xalanc::XalanTransformer::setStylesheetParam ( const XalanDOMString key,
double  number 
)

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
keyname of the param
numbervalue to be evaluated

◆ setStylesheetParam() [7/8]

void xalanc::XalanTransformer::setStylesheetParam ( const XalanDOMString key,
XalanNode nodeset 
)

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
keyname of the param
nodesetXML nodeset that will be evaluated

◆ setStylesheetParam() [8/8]

void xalanc::XalanTransformer::setStylesheetParam ( const XalanDOMString key,
XObjectPtr  object 
)

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
keyname of the param
objectany XObject owned by the transformer

◆ setUseValidation()

void xalanc::XalanTransformer::setUseValidation ( bool  fValue)
inline

Set a flag to indicate whether or not the source file(s) for the transformation will be validated.

Parameters
fValuethe new value for the flag.

Definition at line 666 of file XalanTransformer.hpp.

◆ setWarningStream()

void xalanc::XalanTransformer::setWarningStream ( StreamType theStream)
inline

Set the ostream instance for reporting warnings and messages.

The default is std::cerr. If set to a null pointer, no warnings or messages are written. If there is a user-installed ProblemListener instance, this is not used, as all such warnings and messages are handled by the that ProblemListener.

Parameters
theStreamA pointer to the ostream instance.

Definition at line 1005 of file XalanTransformer.hpp.

◆ setXMLEntityResolver()

void xalanc::XalanTransformer::setXMLEntityResolver ( XMLEntityResolver *  theResolver)
inline

Installs the supplied XMLEntityResolver.

A call to setXMLEntityResolver with a non-null pointer will uninstall any EntityResolver previously installed.

Parameters
theResolverA pointer to the XMLEntityResolver.

Definition at line 721 of file XalanTransformer.hpp.

◆ terminate()

static void xalanc::XalanTransformer::terminate ( )
static

Terminate Xalan.

Should be called only once per process after deleting all instances of XalanTransformer. This call is not thread-safe, so you must serialize any calls to it, and you must track the initialization state, so you do not call it more than once.

This is handy when using leak-detection software, as all static data allocated by Xalan is freed.

◆ transform() [1/9]

int xalanc::XalanTransformer::transform ( const XalanParsedSource theParsedSource,
const XalanCompiledStylesheet theCompiledStylesheet,
void *  theOutputHandle,
XalanOutputHandlerType  theOutputHandler,
XalanFlushHandlerType  theFlushHandler = 0 
)

Transform will apply the compiled stylesheet to the source and write the transformation result to a callback function
in pre-allocated blocks.

The input source can be a file name, a stream or a root node. Upon termination, Xalan releases any allocated memory. Data passed to the callback is not guaranteed to be null terminated.

Parameters
theParsedSourceParsed source instance
theCompiledStylesheetpointer to a compiled stylesheet. Must not be null.
theOutputHandlevoid pointer passed through to callback.
theOutputHandlera user defined callback function.
theFlushHandlerAn optional user-defined callback function.
Returns
0 for success

◆ transform() [2/9]

int xalanc::XalanTransformer::transform ( const XalanParsedSource theParsedXML,
const XalanCompiledStylesheet theCompiledStylesheet,
const XSLTResultTarget theResultTarget 
)
inline

Transform will apply the compiled stylesheet to the parsed xml source and write the transformation output to the target.

Parameters
theParsedXMLthe parsed input source
theCompiledStylesheetpointer to a compiled stylesheet. Must not be null.
theResultTargetoutput source
Returns
0 for success

Definition at line 201 of file XalanTransformer.hpp.

◆ transform() [3/9]

int xalanc::XalanTransformer::transform ( const XalanParsedSource theParsedXML,
const XSLTInputSource theStylesheetSource,
const XSLTResultTarget theResultTarget 
)
inline

Transform will apply the stylesheet source to the parsed xml source and write the transformation output to the target.

Parameters
theParsedXMLthe parsed input source
theStylesheetSourcestylesheet source
theResultTargetoutput source
Returns
0 for success

Definition at line 183 of file XalanTransformer.hpp.

◆ transform() [4/9]

int xalanc::XalanTransformer::transform ( const XalanParsedSource theParsedXML,
const XSLTResultTarget theResultTarget 
)
inline

Transform will apply the stylesheet provided as a PI in the XML of the parsed xml source and write the transformation output to the target.

Parameters
theParsedXMLthe parsed input source
theResultTargetoutput source tree
Returns
0 for success

Definition at line 221 of file XalanTransformer.hpp.

◆ transform() [5/9]

int xalanc::XalanTransformer::transform ( const XSLTInputSource theInputSource,
const XalanCompiledStylesheet theCompiledStylesheet,
const XSLTResultTarget theResultTarget 
)

Transform will apply the compiled stylesheet to the input source and write the transformation output to the target.

The input source and result target can be a file name, a stream or a root node.

Parameters
theInputSourceinput source
theCompiledStylesheetpointer to a compiled stylesheet. Must not be null.
theResultTargetoutput source
Returns
0 for success

◆ transform() [6/9]

int xalanc::XalanTransformer::transform ( const XSLTInputSource theInputSource,
const XSLTInputSource theStylesheetSource,
const XSLTResultTarget theResultTarget 
)

Transform will apply the stylesheet source to the input source and write the transformation output to the target.

The input source and result target can be a file name, a stream or a root node.

Parameters
theInputSourceinput source
theStylesheetSourcestylesheet source
theResultTargetoutput source
Returns
0 for success

◆ transform() [7/9]

int xalanc::XalanTransformer::transform ( const XSLTInputSource theInputSource,
const XSLTInputSource theStylesheetSource,
void *  theOutputHandle,
XalanOutputHandlerType  theOutputHandler,
XalanFlushHandlerType  theFlushHandler = 0 
)

Transform will apply the stylesheet source to the input source and write the transformation result to a callback function
in pre-allocated blocks.

The input source can be a file name, a stream or a root node. Upon termination, Xalan releases any allocated memory. Data passed to the callback is not guaranteed to be null terminated.

Parameters
theInputSourceinput source
theStylesheetSourcestylesheet source
theOutputHandlevoid pointer passed through to callback.
theOutputHandlera user defined (callback) function.
theFlushHandler(optional) a user defined (callback) function.
Returns
0 for success

◆ transform() [8/9]

int xalanc::XalanTransformer::transform ( const XSLTInputSource theInputSource,
const XSLTResultTarget theResultTarget 
)
inline

Transform will apply the stylesheet provided as a PI in the XML of the input source and write the transformation output to the target.

The input source and result target can be a file name, a stream or a root node.

Parameters
theInputSourceinput source
theResultTargetoutput source tree
Returns
0 for success

Definition at line 258 of file XalanTransformer.hpp.

◆ transform() [9/9]

int xalanc::XalanTransformer::transform ( const XSLTInputSource theInputSource,
void *  theOutputHandle,
XalanOutputHandlerType  theOutputHandler,
XalanFlushHandlerType  theFlushHandler = 0 
)

Transform will apply the stylesheet provided as a PI in the XML of the input source and write the transformation result to a
callback function in pre-allocated blocks.

The input source can be a file name, a stream or a root node. Upon termination, Xalan releases any allocated memory. Data passed to the callback is not guaranteed to be null terminated.

Parameters
theInputSourceinput source
theOutputHandlevoid pointer passed through to callback.
theOutputHandlera user defined callback function.
theFlushHandleran optional user-defined callback function.
Returns
0 for success

◆ uninstallExternalFunction()

void xalanc::XalanTransformer::uninstallExternalFunction ( const XalanDOMString theNamespace,
const XalanDOMString functionName 
)

Uninstall an external local function.

Parameters
theNamespaceThe namespace for the function
functionNameThe name of the function.

◆ uninstallExternalFunctionGlobal()

static void xalanc::XalanTransformer::uninstallExternalFunctionGlobal ( const XalanDOMString theNamespace,
const XalanDOMString functionName 
)
static

Uninstall an external global function.

Parameters
theNamespaceThe namespace for the function
functionNameThe name of the function.

Friends And Related Function Documentation

◆ EnsureReset

friend class EnsureReset
friend

Definition at line 1145 of file XalanTransformer.hpp.


The documentation for this class was generated from the following file: