This is a simple C++ interface for some common usage patterns. More...
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.
typedef std::ostream XalanTransformer::StreamType |
typedef XalanVector<const XalanCompiledStylesheet*> XalanTransformer::CompiledStylesheetPtrVectorType |
typedef XalanVector<const XalanParsedSource*> XalanTransformer::ParsedSourcePtrVectorType |
typedef XALAN_STD_QUALIFIER pair<XalanDOMString*, XalanDOMString*> XalanTransformer::ParamPairType |
typedef XALAN_STD_QUALIFIER pair<XalanQNameByValue*, Function*> XalanTransformer::FunctionPairType |
XalanTransformer::XalanTransformer | ( | MemoryManagerType & | theManager = XalanMemMgrs::getDefaultXercesMemMgr() |
) |
virtual XalanTransformer::~XalanTransformer | ( | ) | [virtual] |
MemoryManagerType& XalanTransformer::getMemoryManager | ( | ) |
const MemoryManagerType& XalanTransformer::getMemoryManager | ( | ) | const |
static void XalanTransformer::initialize | ( | MemoryManagerType & | 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.
static void 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.
static void 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.
static void XalanTransformer::ICUStartUp | ( | MemoryManagerType & | theManager = XalanMemMgrs::getDefaultXercesMemMgr() |
) | [static] |
int XalanTransformer::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.
theParsedXML | the parsed input source | |
theStylesheetSource | stylesheet source | |
theResultTarget | output source |
int XalanTransformer::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.
theParsedXML | the parsed input source | |
theCompiledStylesheet | pointer to a compiled stylesheet. Must not be null. | |
theResultTarget | output source |
int XalanTransformer::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.
theParsedXML | the parsed input source | |
theResultTarget | output source tree |
int 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.
theInputSource | input source | |
theStylesheetSource | stylesheet source | |
theResultTarget | output source |
int XalanTransformer::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.
The input source and result target can be a file name, a stream or a root node.
theInputSource | input source | |
theResultTarget | output source tree |
int 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.
theInputSource | input source | |
theStylesheetSource | stylesheet source | |
theOutputHandle | void pointer passed through to callback. | |
theOutputHandler | a user defined (callback) function. | |
theFlushHandler | (optional) a user defined (callback) function. |
int 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.
theInputSource | input source | |
theCompiledStylesheet | pointer to a compiled stylesheet. Must not be null. | |
theResultTarget | output source |
int 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.
theParsedSource | Parsed source instance | |
theCompiledStylesheet | pointer to a compiled stylesheet. Must not be null. | |
theOutputHandle | void pointer passed through to callback. | |
theOutputHandler | a user defined callback function. | |
theFlushHandler | An optional user-defined callback function. |
int 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.
theInputSource | input source | |
theOutputHandle | void pointer passed through to callback. | |
theOutputHandler | a user defined callback function. | |
theFlushHandler | an optional user-defined callback function. |
int 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.
theStylesheetSource | input source | |
theCompiledStylesheet | a reference to a pointer to a XalanCompileStylesheet. |
int XalanTransformer::destroyStylesheet | ( | const XalanCompiledStylesheet * | theStylesheet | ) |
Destroy a XalanCompiledStylesheet instance created by a previous call to compileStylesheet().
theStylesheet | The instance to destroy. |
int 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.
theInputSource | input source | |
theParsedSource | a reference to a pointer to a XalanParsedSource. | |
useXercesDOM | input use default or xerces DOM source tree |
int XalanTransformer::destroyParsedSource | ( | const XalanParsedSource * | theParsedSource | ) |
Destroy a parsed source created by a previous call to parseSource().
theParsedSource | The XalanParsedSource instance to destroy. |
XalanDocumentBuilder* 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.
theURI | The base URI for the document instance. |
void 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.
theDocumentBuilder | The document builder to destroy. |
void XalanTransformer::installExternalFunction | ( | const XalanDOMString & | theNamespace, | |
const XalanDOMString & | functionName, | |||
const Function & | function | |||
) |
Install an external function in the local space.
theNamespace | The namespace for the functionl | |
functionName | The name of the function. | |
function | The function to install. |
static void XalanTransformer::installExternalFunctionGlobal | ( | const XalanDOMString & | theNamespace, | |
const XalanDOMString & | functionName, | |||
const Function & | function | |||
) | [static] |
Install an external function in the global space.
theNamespace | The namespace for the functionl | |
functionName | The name of the function. | |
function | The function to install. |
void XalanTransformer::uninstallExternalFunction | ( | const XalanDOMString & | theNamespace, | |
const XalanDOMString & | functionName | |||
) |
Uninstall an external local function.
theNamespace | The namespace for the function | |
functionName | The name of the function. |
static void XalanTransformer::uninstallExternalFunctionGlobal | ( | const XalanDOMString & | theNamespace, | |
const XalanDOMString & | functionName | |||
) | [static] |
Uninstall an external global function.
theNamespace | The namespace for the function | |
functionName | The name of the function. |
void XalanTransformer::setStylesheetParam | ( | const XalanDOMString & | key, | |
const XalanDOMString & | expression | |||
) |
Set a top-level stylesheet parameter.
This value can be evaluated via xsl:param-variable. These values are cleared after a call to transform().
key | name of the param | |
expression | expression that will be evaluated |
void XalanTransformer::setStylesheetParam | ( | const char * | key, | |
const char * | expression | |||
) |
Set a top-level stylesheet parameter.
This value can be evaluated via xsl:param-variable. These values are cleared after a call to transform().
key | name of the param | |
expression | expression that will be evaluated |
void XalanTransformer::addTraceListener | ( | TraceListener * | theTraceListener | ) |
Add a TraceListener instance.
TraceListeners instances are preserved between calls to transform(), so they will be called until they are removed.
theTraceListener | The instance to add. |
bool XalanTransformer::removeTraceListener | ( | TraceListener * | theTraceListener | ) |
Remove a TraceListener instance.
theTraceListener | The instance to remove. |
void XalanTransformer::removeTraceListeners | ( | ) |
Remove all TraceListener instances.
bool XalanTransformer::getUseValidation | ( | ) | const |
Set a flag to indicate whether or not the source file(s) for the transformation will be validated.
fValue | the new value for the flag. |
void XalanTransformer::setUseValidation | ( | bool | fValue | ) |
Set a flag to indicate whether or not the source file(s) for the transformation will be validated.
fValue | the new value for the flag. |
EntityResolverType* XalanTransformer::getEntityResolver | ( | ) | const |
This method returns the installed entity resolver.
void XalanTransformer::setEntityResolver | ( | EntityResolverType * | theResolver | ) |
This method installs the user-specified entity resolver.
It allows applications to trap and redirect calls to external entities.
handler | A pointer to the entity resolver to be called when the parser comes across references to entities in the XML file. |
ErrorHandlerType* XalanTransformer::getErrorHandler | ( | ) | const |
This method returns the installed error handler.
void XalanTransformer::setErrorHandler | ( | ErrorHandlerType * | theErrorHandler | ) |
This method installs the user-specified error handler.
handler | A pointer to the error handler to be called upon error. |
const XalanDOMChar* XalanTransformer::getExternalSchemaLocation | ( | ) | const |
This method returns the location for an external schema document for parsing.
void XalanTransformer::setExternalSchemaLocation | ( | const XalanDOMChar * | location | ) |
This method sets the location for an external schema document for parsing.
location | A string representing the location of the external schema document |
const XalanDOMChar* XalanTransformer::getExternalNoNamespaceSchemaLocation | ( | ) | const |
This method returns the location for an external schema document for parsing.
void XalanTransformer::setExternalNoNamespaceSchemaLocation | ( | const XalanDOMChar * | location | ) |
This method sets the location for an external schema document for parsing.
location | A string representing the location of the external schema document |
bool XalanTransformer::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.
void XalanTransformer::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.
This can result in significant memory savings if there are lots of repeated values in text nodes.
fPool | The boolean value for the flag. |
ProblemListener* XalanTransformer::getProblemListener | ( | ) | const |
This method returns the installed ProblemListener instance.
void XalanTransformer::setProblemListener | ( | ProblemListener * | theProblemListener | ) |
This method installs the user-specified ProblemListener instance.
handler | A pointer to the ProblemListener to be called when a problem occurs. |
const char* XalanTransformer::getLastError | ( | ) | const |
Returns the last error that occurred as a result of calling transform.
const XalanDOMString& XalanTransformer::getOutputEncoding | ( | ) | const |
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
void XalanTransformer::setOutputEncoding | ( | const XalanDOMString & | theEncoding | ) |
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.
theEncoding | The encoding to use. |
int XalanTransformer::getIndent | ( | ) | const |
Get the current number of spaces to indent.
void XalanTransformer::setIndent | ( | int | indentAmount | ) |
Set the current number of spaces to indent.
indentAmount | The number of spaces to indent. Use -1 for the default amount. |
eEscapeURLs 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.
void 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.
value | The value of the enum |
eOmitMETATag 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.
void 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.
value | The value of the enum |
void XalanTransformer::setWarningStream | ( | StreamType * | theStream | ) |
Set the ostream instance for reporting warnings and messages.
The default is std::cerr. If set to 0, no warnings or messages will be written. If there is a user-installed ProblemListener instance, this is not used, as all such warnings and messages are handled by the user's ProblemListener.
theStream | A pointer to the ostream instance. |
StreamType* XalanTransformer::getWarningStream | ( | ) | const |
Get the current warning stream ostream instance.
friend class EnsureReset [friend] |
The documentation for this class was generated from the following file:
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.10 |
|