Saxon/C  0.3.1
Saxon Processor library for C/C++
 All Classes Functions Variables
Public Member Functions | List of all members
XsltProcessor Class Reference

#include <XsltProcessor.h>

Public Member Functions

 XsltProcessor (SaxonProcessor *proc, bool license=false, string cwd="")
 A constructor. More...
 
void setSourceValue (XdmValue *value)
 
void setSourceFile (const char *filename)
 
void setOutputfile (const char *outfile)
 
void setParameter (const char *name, XdmValue *value)
 
XdmValuegetParameter (const char *name)
 
bool removeParameter (const char *name)
 
void setProperty (const char *name, const char *value)
 
const char * getProperty (const char *name)
 
void clearParameters ()
 
void clearProperties ()
 
void xsltSaveResultToFile (const char *sourcefile, const char *stylesheetfile, const char *outputfile)
 
const char * xsltApplyStylesheet (const char *sourcefile, const char *stylesheetfile)
 
XdmValuexsltApplyStylesheetToValue (const char *sourcefile, const char *stylesheetfile)
 
XdmValueparseXmlFile (const char *filename)
 
XdmValueparseXmlString (const char *str)
 
void compile (const char *stylesheet)
 
void compileString (const char *stylesheet)
 
void releaseStylesheet ()
 
const char * transformToString ()
 
XdmValuetransformToValue ()
 
bool exceptionOccurred ()
 
SaxonApiExceptioncheckException ()
 
void exceptionClear ()
 
int exceptionCount ()
 
const char * getErrorMessage (int i)
 
const char * getErrorCode (int i)
 
string sizes (int number)
 
SaxonProcessorgetSaxonProcessor ()
 
string checkFailures ()
 

Detailed Description

An XsltProcessor represents factory to compile, load and execute a stylesheet. It is possible to cache the context and the stylesheet in the XsltProcessor.

Constructor & Destructor Documentation

XsltProcessor::XsltProcessor ( SaxonProcessor proc,
bool  license = false,
string  cwd = "" 
)

A constructor.

license flag not required in Saxon-HE product cwd - set the current working directory

Member Function Documentation

string XsltProcessor::checkFailures ( )
inline

Method for testing purposes. Available only in alpha release

void XsltProcessor::clearParameters ( )

Clear parameter values set

void XsltProcessor::clearProperties ( )

Clear property values set

void XsltProcessor::compile ( const char *  stylesheet)

compile a stylesheet file.

Parameters
stylesheet- The file name of the stylesheet document.
void XsltProcessor::compileString ( const char *  stylesheet)

compile a stylesheet received as a string.

Parameters
stylesheetas a lexical string representation
bool XsltProcessor::exceptionOccurred ( )

Checks for pending exceptions without creating a local reference to the exception object

Returns
bool - true when there is a pending exception; otherwise return false
XdmValue * XsltProcessor::getParameter ( const char *  name)

Get a parameter value by name

Parameters
name- Specified paramater name to get
Returns
XdmValue
const char * XsltProcessor::getProperty ( const char *  name)

Get a property value by name

Parameters
name- Specified paramater name to get
Returns
string - Get string of the property as char pointer array
XdmValue * XsltProcessor::parseXmlFile ( const char *  filename)

Parses an XML file and saves it as the source document in the transformation.

Parameters
filename- The file name of the source document.
XdmValue * XsltProcessor::parseXmlString ( const char *  str)

Parses an XML lexical string and saves it as the source document in the transformation.

Parameters
str- The source document as a string.
bool XsltProcessor::removeParameter ( const char *  name)

Remove a parameter (name, value) pair from a stylesheet

Parameters
namethe name of the stylesheet parameter
Returns
bool - outcome of the romoval
void XsltProcessor::setOutputfile ( const char *  outfile)

Set the output file of where the transformation result is sent

void XsltProcessor::setParameter ( const char *  name,
XdmValue value 
)

Set the value of a stylesheet parameter

Parameters
namethe name of the stylesheet parameter, as a string. For namespaced parameter use the JAXP solution i.e. "{uri}name"
valuethe value of the stylesheet parameter, or null to clear a previously set value
void XsltProcessor::setProperty ( const char *  name,
const char *  value 
)

Set a property.

Parameters
nameof the property
valueof the property
void XsltProcessor::setSourceFile ( const char *  filename)

Set the source from file for the transformation.

void XsltProcessor::setSourceValue ( XdmValue value)

Set the source document from a XdmValue for the transformation.

string XsltProcessor::sizes ( int  number)
inline

Method for testing purposes. Available only in alpha release

const char* XsltProcessor::transformToString ( )

Perform the transformation returned as a string. Not implemented yet. Available in next release

XdmValue* XsltProcessor::transformToValue ( )

Perform the transformation returned as a XdmValue. Not implemented yet. Available in next release

const char * XsltProcessor::xsltApplyStylesheet ( const char *  sourcefile,
const char *  stylesheetfile 
)

Perform a one shot transformation. The result is returned as a string

Parameters
sourcefile- The file name of the source document
stylesheetfile- The file name of the stylesheet document
Returns
char array - result of the transformation
XdmValue * XsltProcessor::xsltApplyStylesheetToValue ( const char *  sourcefile,
const char *  stylesheetfile 
)

Perform a one shot transformation. The result is returned as an XdmValue

Parameters
sourcefile- The file name of the source document
stylesheetfile- The file name of the stylesheet document
Returns
XdmValue - result of the transformation
void XsltProcessor::xsltSaveResultToFile ( const char *  sourcefile,
const char *  stylesheetfile,
const char *  outputfile 
)

Perform a one shot transformation. The result is stored in the supplied outputfile.

Parameters
sourcefile- The file name of the source document
stylesheetfile- The file name of the stylesheet document
outputfile- The file name where results will be stored

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