zorba::XmlDataManager

#include <zorba/xmldatamanager.h>

Inherited from: zorba::SmartObject

Using the XmlDataManager one can manage documents and collections. An instance of XmlDataManager can be obtained via the Zorba::getXmlDataManager() method. The instance must be destroyed before Zorba::shutdown() is called.

Public Functions

void

addReference() const

void

free()

CollectionManager *

getCollectionManager() const =0

Returns a CollectionManager responsible for all collections.

DocumentManager *

getDocumentManager() const =0

Returns a DocumentManager responsible for managing XML documents.

long

getRefCount() const

CollectionManager *

getW3CCollectionManager() const =0

Returns a CollectionManager responsible for collections identified by a URI.

Item

parseXML(std::istream &aStream) const =0

Parse an XML document and return an Item.

Item

parseXML(std::istream &aStream, const String &aBaseURI) const =0

Parse an XML document and return an Item.

ItemSequence_t

parseXML(std::istream &aStream, ParseOptions &aOptions) const =0

Parse an XML document and return a sequence of nodes.

ItemSequence_t

parseXML(std::istream &aStream, const String &aBaseURI, ParseOptions &aOptions) const =0

Parse an XML document and return a sequence of nodes.

void

registerDiagnosticHandler(DiagnosticHandler *aDiagnosticHandler)=0

Register a DiagnosticHandler to which errors occuring during the management of documents and collections are reported.

void

registerStemmerProvider(StemmerProvider const *provider)=0

Registers a StemmerProvider to use for stemming of text content in order to perform queries involving full-text.

void

registerTokenizerProvider(TokenizerProvider const *provider)=0

Registers a TokenizerProvider to use for toknenization of text content in order to perform queries involving full-text.

void

removeReference()

Protected Functions

~XmlDataManager()

Destructor.

Protected Attributes

unsigned int

theRefCount

Public Functions

addReference

void addReference() const

free

void free()

getCollectionManager

CollectionManager * getCollectionManager() const =0

Returns a CollectionManager responsible for all collections.

The collection manager provides a set of functions for managing collections identified by a QName and their contents.Please note that the resulting manager is only responsible for dynamic collections identified by a QName, i.e. those that are not declared in the prolog of a module or identified by a URI.

Returns

The collection manager responsible for managing collections.

getDocumentManager

DocumentManager * getDocumentManager() const =0

Returns a DocumentManager responsible for managing XML documents.

getRefCount

long getRefCount() const

getW3CCollectionManager

CollectionManager * getW3CCollectionManager() const =0

Returns a CollectionManager responsible for collections identified by a URI.

The collection manager provides a set of functions for managing collections identified by a URI and their contents.Please note that the resulting manager is only responsible for dynamic collections identified by a URI, i.e. those that are not declared in the prolog of a module or identified by a QName.

Returns

The collection manager responsible for managing collections.

parseXML

Item parseXML(std::istream &aStream) const =0

Parse an XML document and return an Item.

parseXML

Item parseXML(std::istream &aStream, const String &aBaseURI) const =0

Parse an XML document and return an Item.

Parameters

aStream the input stream whose content should be parsed
aBaseURI the base URI which will be used as the base URI of the document. This serves both as the base URI used by the XML parser to resolve relative entity references within the document, and as the base URI of the document node that is returned.

parseXML

ItemSequence_t parseXML(std::istream &aStream, ParseOptions &aOptions) const =0

Parse an XML document and return a sequence of nodes.

This function parses the given input stream and returns the result as a sequence of nodes. If external entity processing is disabled the result will be a singleton sequence consisting of one document node. Otherwise, the result is the sequence of the external entity nodes.

Parameters

aStream the input stream whose content should be parsed
aOptions

parseXML

ItemSequence_t parseXML(std::istream &aStream, const String &aBaseURI, ParseOptions &aOptions) const =0

Parse an XML document and return a sequence of nodes.

This function parses the given input stream and returns the result as a sequence of nodes. If external entity processing is disabled the result will be a singleton sequence consisting of one document node. Otherwise, the result is the sequence of the external entity nodes.

Parameters

aStream the input stream whose content should be parsed
aBaseURI the base URI which will be used as the base URI of the document. This serves both as the base URI used by the XML parser to resolve relative entity references within the document, and as the base URI of the document node that is returned.
aOptions

registerDiagnosticHandler

void registerDiagnosticHandler(DiagnosticHandler *aDiagnosticHandler)=0

Register a DiagnosticHandler to which errors occuring during the management of documents and collections are reported.

If no DiagnosticHandler has been set using this function then subclasses of the ZorbaException class are thrown to report errors.

Parameters

aDiagnosticHandler DiagnosticHandler to which errors are reported. The caller retains ownership over the DiagnosticHandler passed as parameter.

registerStemmerProvider

void registerStemmerProvider(StemmerProvider const *provider)=0

Registers a StemmerProvider to use for stemming of text content in order to perform queries involving full-text.

If no StemmerProvider has been set using this function, then the default StemmerProvider will be used.

Parameters

provider If not NULL, sets the StemmerProvider to use; if NULL, removes any previously registered StemmerProvider.

registerTokenizerProvider

void registerTokenizerProvider(TokenizerProvider const *provider)=0

Registers a TokenizerProvider to use for toknenization of text content in order to perform queries involving full-text.

If no TokenizerProvider has been set using this function, then the default TokenizerProvider will be used.

Parameters

provider If not NULL, sets the TokenizerProvider to use; if NULL, removes any previously registered TokenizerProvider.

removeReference

void removeReference()

Protected Functions

~XmlDataManager

 ~XmlDataManager()

Destructor.

Protected Attributes

theRefCount

unsigned int theRefCount