Saxon/C  1.2.1
Saxon Processor library for C/C++, PHP and Python
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 ()
 Get the Processor object. Method used in Python. More...
 
Xslt30ProcessornewXslt30Processor ()
 
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 (const char *str)
 
XdmAtomicValuemakeAtomicValue (const char *type, const char *value)
 
const char * getStringValue (XdmItem *item)
 
XdmNodeparseXmlFromString (const char *source)
 
XdmNodeparseXmlFromFile (const char *source)
 
XdmNodeparseXmlFromUri (const char *source)
 
int getNodeKind (jobject)
 
bool isSchemaAwareProcessor ()
 
bool exceptionOccurred ()
 
void exceptionClear (bool clearCPPException=true)
 
SaxonApiExceptioncheckForExceptionCPP (JNIEnv *env, jclass callingClass, jobject callingObject)
 
SaxonApiExceptiongetException ()
 
void setcwd (const char *cwd)
 
const char * getcwd ()
 
void setResourcesDirectory (const char *dir)
 
void setCatalog (const char *catalogFile, bool isTracing)
 
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 Xslt30Processor
 
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

Constructor & Destructor Documentation

◆ SaxonProcessor() [1/3]

SaxonProcessor::SaxonProcessor ( )

A default constructor.

Create Saxon Processor.

◆ SaxonProcessor() [2/3]

SaxonProcessor::SaxonProcessor ( const char *  configFile)

constructor based upon a Saxon configuration file.

Create Saxon Processor.

◆ SaxonProcessor() [3/3]

SaxonProcessor::SaxonProcessor ( bool  l)

A constructor.

Create Saxon Processor.

Parameters
l- Flag that a license is to be used. Default is false.

◆ ~SaxonProcessor()

SaxonProcessor::~SaxonProcessor ( )

Destructor

Member Function Documentation

◆ checkForExceptionCPP()

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

◆ clearConfigurationProperties()

void SaxonProcessor::clearConfigurationProperties ( )

Clear configuration properties specific to the processor in use.

◆ exceptionClear()

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.

◆ exceptionOccurred()

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

◆ getcwd()

const char * SaxonProcessor::getcwd ( )

get the current working directory

◆ getResourcesDirectory()

const char * SaxonProcessor::getResourcesDirectory ( )

get saxon resources directory

◆ getStringValue()

const char * SaxonProcessor::getStringValue ( XdmItem item)

Get the string representation of the XdmValue.

Returns
char array

◆ makeAtomicValue()

XdmAtomicValue * SaxonProcessor::makeAtomicValue ( const char *  type,
const char *  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

◆ makeBooleanValue()

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

◆ makeDoubleValue()

XdmAtomicValue * SaxonProcessor::makeDoubleValue ( double  d)

Factory method (for convenience in compiled bytecode)

Parameters
dthe value of the double
Returns
a new XdmAtomicValue

◆ makeFloatValue()

XdmAtomicValue * SaxonProcessor::makeFloatValue ( float  d)

Factory method (for convenience in compiled bytecode)

Parameters
fthe value of the foat
Returns
a new XdmAtomicValue

◆ makeIntegerValue()

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

◆ makeLongValue()

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

◆ makeQNameValue()

XdmAtomicValue * SaxonProcessor::makeQNameValue ( const char *  str)

Create an QName Xdm value from string representation in clark notation

Parameters
str- The value given in a string form in clark notation. {uri}local
Returns
XdmAtomicValue - value

◆ makeStringValue() [1/2]

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

◆ makeStringValue() [2/2]

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

◆ newSchemaValidator()

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

◆ newXPathProcessor()

XPathProcessor * SaxonProcessor::newXPathProcessor ( )

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

Returns
a newly created XPathProcessor

◆ newXQueryProcessor()

XQueryProcessor * SaxonProcessor::newXQueryProcessor ( )

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

Returns
a newly created XQueryProcessor

◆ newXslt30Processor()

Xslt30Processor * SaxonProcessor::newXslt30Processor ( )

Create an Xslt30Processor. An Xslt30Processor is used to compile XSLT30 stylesheets.

Returns
a newly created Xslt30Processor

◆ newXsltProcessor()

XsltProcessor * SaxonProcessor::newXsltProcessor ( )

Get the Processor object. Method used in Python.

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

Returns
a newly created XsltProcessor

◆ parseXmlFromFile()

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

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

◆ parseXmlFromString()

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

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

◆ parseXmlFromUri()

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

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

◆ setCatalog()

void SaxonProcessor::setCatalog ( const char *  catalogFile,
bool  isTracing 
)

set catalog to be used in Saxon

◆ setConfigurationProperty()

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

◆ setcwd()

void SaxonProcessor::setcwd ( const char *  cwd)

set the current working directory

◆ setResourcesDirectory()

void SaxonProcessor::setResourcesDirectory ( const char *  dir)

set saxon resources directory

◆ version()

const char * SaxonProcessor::version ( )

Get the Saxon version

Returns
char array

Member Data Documentation

◆ configProperties

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

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

◆ cwd

std::string SaxonProcessor::cwd

current working directory

◆ cwdV

std::string SaxonProcessor::cwdV
protected

current working directory

◆ exception

SaxonApiException* SaxonProcessor::exception
protected

Pointer to any potential exception thrown

◆ licensei

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

◆ nativeMethodVect

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

Vector of native methods defined by user

◆ parameters

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

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

◆ proc

jobject SaxonProcessor::proc

Java Processor object


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