Saxon/C  1.1.2
Saxon Processor library for C/C++/PHP
 All Classes Functions Variables
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Friends | List of all members
SaxonProcessor Class Reference

#include <SaxonProcessor.h>

Public Member Functions

 SaxonProcessor ()
 A default constructor. More...
 
 SaxonProcessor (const char *configFile)
 constructor based upon a Saxon configuration file. More...
 
 SaxonProcessor (bool l)
 A constructor. More...
 
SaxonProcessoroperator= (const SaxonProcessor &other)
 
 ~SaxonProcessor ()
 
XsltProcessornewXsltProcessor ()
 
XQueryProcessornewXQueryProcessor ()
 
XPathProcessornewXPathProcessor ()
 
SchemaValidatornewSchemaValidator ()
 
XdmAtomicValuemakeStringValue (std::string str)
 
XdmAtomicValuemakeStringValue (const char *str)
 
XdmAtomicValuemakeIntegerValue (int i)
 
XdmAtomicValuemakeDoubleValue (double d)
 
XdmAtomicValuemakeFloatValue (float)
 
XdmAtomicValuemakeLongValue (long l)
 
XdmAtomicValuemakeBooleanValue (bool b)
 
XdmAtomicValuemakeQNameValue (std::string str)
 
XdmAtomicValuemakeAtomicValue (std::string type, std::string value)
 
const char * getStringValue (XdmItem *item)
 
XdmNodeparseXmlFromString (const char *source)
 
XdmNodeparseXmlFromFile (const char *source)
 
XdmNodeparseXmlFromUri (const char *source)
 
int getNodeKind (jobject)
 
bool isSchemaAware ()
 
bool exceptionOccurred ()
 
void exceptionClear (bool clearCPPException=true)
 
SaxonApiExceptioncheckForExceptionCPP (JNIEnv *env, jclass callingClass, jobject callingObject)
 
SaxonApiExceptiongetException ()
 
void setcwd (const char *cwd)
 
void setResourcesDirectory (const char *dir)
 
const char * getResourcesDirectory ()
 
void setConfigurationProperty (const char *name, const char *value)
 
void clearConfigurationProperties ()
 
const char * version ()
 
void addNativeMethod (char *name, char *signature, void *fnPtr)
 
bool registerCPPFunction (char *libName, JNINativeMethod *gMethods=NULL)
 
const char * checkException (jobject cpp)
 
void checkAndCreateException (jclass cppClass)
 

Static Public Member Functions

static void release ()
 
static bool registerNativeMethods (JNIEnv *env, const char *className, JNINativeMethod *gMethods, int numMethods)
 

Public Attributes

std::string cwd
 
jobject proc
 

Static Public Attributes

static int jvmCreatedCPP =0
 
static sxnc_environmentsxn_environ = 0
 
static int refCount = 0
 

Protected Attributes

jclass xdmAtomicClass
 
jclass versionClass
 
jclass procClass
 
jclass saxonCAPIClass
 
std::string cwdV
 
char * versionStr
 
std::map< std::string, XdmValue * > parameters
 
std::map< std::string,
std::string > 
configProperties
 
bool licensei
 
bool closed
 
SaxonApiExceptionexception
 
JNINativeMethod * nativeMethods
 
std::vector< JNINativeMethod > nativeMethodVect
 

Friends

class XsltProcessor
 
class XQueryProcessor
 
class SchemaValidator
 
class XPathProcessor
 
class XdmValue
 
class XdmAtomicValue
 

Detailed Description

An SaxonProcessor acts as a factory for generating XQuery, XPath, Schema and XSLT compilers In this alpha release only the XSLT compiler is available

Constructor & Destructor Documentation

SaxonProcessor::SaxonProcessor ( )

A default constructor.

Create Saxon Processor.

SaxonProcessor::SaxonProcessor ( const char *  configFile)

constructor based upon a Saxon configuration file.

Create Saxon Processor.

SaxonProcessor::SaxonProcessor ( bool  l)

A constructor.

Create Saxon Processor.

Parameters
l- Flag that a license is to be used. Default is false.
SaxonProcessor::~SaxonProcessor ( )

Destructor

Member Function Documentation

SaxonApiException * SaxonProcessor::checkForExceptionCPP ( JNIEnv *  env,
jclass  callingClass,
jobject  callingObject 
)

Checks for pending exceptions and creates a SaxonApiException object, which handles one or more local exceptions objects

Parameters
env
callingClass
callingObject
Returns
SaxonApiException
void SaxonProcessor::clearConfigurationProperties ( )

Clear configuration properties specific to the processor in use.

void SaxonProcessor::exceptionClear ( bool  clearCPPException = true)

Clears any exception that is currently being thrown. If no exception is currently being thrown, this routine has no effect.

bool SaxonProcessor::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
const char * SaxonProcessor::getResourcesDirectory ( )

get saxon resources directory

const char * SaxonProcessor::getStringValue ( XdmItem item)

Get the string representation of the XdmValue.

Returns
char array
XdmAtomicValue * SaxonProcessor::makeAtomicValue ( std::string  type,
std::string  value 
)

Create an Xdm Atomic value from string representation

Parameters
type- Local name of a type in the XML Schema namespace.
value- The value given in a string form. In the case of a QName the value supplied must be in clark notation. {uri}local
Returns
XdmValue - value
XdmAtomicValue * SaxonProcessor::makeBooleanValue ( bool  b)

Factory method: makes a XdmAtomicValue representing a boolean Value

Parameters
btrue or false, to determine which boolean value is required
Returns
the XdmAtomicValue requested
XdmAtomicValue * SaxonProcessor::makeDoubleValue ( double  d)

Factory method (for convenience in compiled bytecode)

Parameters
dthe value of the double
Returns
a new XdmAtomicValue
XdmAtomicValue * SaxonProcessor::makeFloatValue ( float  d)

Factory method (for convenience in compiled bytecode)

Parameters
fthe value of the foat
Returns
a new XdmAtomicValue
XdmAtomicValue * SaxonProcessor::makeIntegerValue ( int  i)

Factory method: makes either an Int64Value or a BigIntegerValue depending on the value supplied

Parameters
ithe supplied primitive integer value
Returns
the value as a XdmAtomicValue which is a BigIntegerValue or Int64Value as appropriate
XdmAtomicValue * SaxonProcessor::makeLongValue ( long  l)

Factory method: makes either an Int64Value or a BigIntegerValue depending on the value supplied

Parameters
lthe supplied primitive long value
Returns
the value as a XdmAtomicValue which is a BigIntegerValue or Int64Value as appropriate
XdmAtomicValue * SaxonProcessor::makeQNameValue ( std::string  str)

Create an QName Xdm value from string representation in clark notation

Parameters
valueStr- The value given in a string form in clark notation. {uri}local
Returns
XdmAtomicValue - value
XdmAtomicValue * SaxonProcessor::makeStringValue ( std::string  str)

Factory method. Unlike the constructor, this avoids creating a new StringValue in the case of a zero-length string (and potentially other strings, in future)

Parameters
valuethe String value. Null is taken as equivalent to "".
Returns
the corresponding StringValue
XdmAtomicValue * SaxonProcessor::makeStringValue ( const char *  str)

Factory method. Unlike the constructor, this avoids creating a new StringValue in the case of a zero-length string (and potentially other strings, in future)

Parameters
valuethe char pointer array. Null is taken as equivalent to "".
Returns
the corresponding StringValue
SchemaValidator * SaxonProcessor::newSchemaValidator ( )

Create a SchemaValidator which can be used to validate instance documents against the schema held by this SchemaManager

Returns
a new SchemaValidator
XPathProcessor * SaxonProcessor::newXPathProcessor ( )

Create an XPathProcessor. An XPathProcessor is used to compile XPath expressions.

Returns
a newly created XPathProcessor
XQueryProcessor * SaxonProcessor::newXQueryProcessor ( )

Create an XQueryProcessor. An XQueryProcessor is used to compile XQuery queries.

Returns
a newly created XQueryProcessor
XsltProcessor * SaxonProcessor::newXsltProcessor ( )

Create an XsltProcessor. An XsltProcessor is used to compile XSLT stylesheets.

Returns
a newly created XsltProcessor
XdmNode * SaxonProcessor::parseXmlFromFile ( const char *  source)

Parse a source document file and return it as an XdmNode.

XdmNode * SaxonProcessor::parseXmlFromString ( const char *  source)

Parse a lexical representation of the source document and return it as an XdmNode

XdmNode * SaxonProcessor::parseXmlFromUri ( const char *  source)

Parse a source document available by URI and return it as an XdmNode.

void SaxonProcessor::setConfigurationProperty ( const char *  name,
const char *  value 
)

Set a configuration property specific to the processor in use. Properties specified here are common across all the processors. Example 'l':enable line number has the value 'on' or 'off'

Parameters
nameof the property
valueof the property

Set a configuration property.

Parameters
nameof the property
valueof the property
void SaxonProcessor::setcwd ( const char *  cwd)

set the current working directory

void SaxonProcessor::setResourcesDirectory ( const char *  dir)

set saxon resources directory

const char * SaxonProcessor::version ( )

Get the Saxon version

Returns
char array

Member Data Documentation

std::map<std::string,std::string> SaxonProcessor::configProperties
protected

map of properties used for the transformation as (string, string) pairs

std::string SaxonProcessor::cwd

current working directory

std::string SaxonProcessor::cwdV
protected

current working directory

SaxonApiException* SaxonProcessor::exception
protected

Pointer to any potential exception thrown

bool SaxonProcessor::licensei
protected

indicates whether the Processor requires a Saxon that needs a license file (i.e. Saxon-EE) other a Saxon-HE Processor is created

std::vector<JNINativeMethod> SaxonProcessor::nativeMethodVect
protected

Vector of native methods defined by user

std::map<std::string,XdmValue*> SaxonProcessor::parameters
protected

map of parameters used for the transformation as (string, value) pairs

jobject SaxonProcessor::proc

Java Processor object


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