CXmlEngDeserializer Class Reference

class CXmlEngDeserializer : public CBase

Provides deserialization and parsing for XML content using a SAX callback interface. Derived classes provide deserialization for specific formats, whereas this class defines the interface and provides default (plain XML) deserialization.

TXmlEngDeserializerType

Deserialization generates SAX events that are passed to a MContentHandler.

Xml::MContentHandler

For deserialization to a DOM tree, see CXmlEngDeserializerDOM. CXmlEngDeserializerDOM

Support for data stored outside the DOM tree, such as data linked by xop:include references, is provided. The external data must be set with UseExternalDataL() prior to deserialization. The data is then returned through the MContentHandler interface.

Inherits from

Constructor & Destructor Documentation

CXmlEngDeserializer()

CXmlEngDeserializer()[private]

Default constructor

~CXmlEngDeserializer()

~CXmlEngDeserializer()[virtual]

Destructor

Member Functions Documentation

ConstructL(Xml::MContentHandler &)

voidConstructL(Xml::MContentHandler &aContentHandler)[private, virtual]

2nd phase constructor

Parameters

Xml::MContentHandler & aContentHandler

DeserializeL()

IMPORT_C voidDeserializeL()[virtual]

Deserializes the file or buffer previously set by SetInputFileL() or SetInputBuffer().

The result of deserialization is passed to the content handler as SAX events.

leave

KXmlEngErrNoParameters No file or buffer has been previously set

leave

  • One of the system wide error codes or one of the Xml specific ones defined in XmlFrameworkErrors.h

DeserializeL(const TDesC &, const TXmlEngParsingOptions &)

IMPORT_C voidDeserializeL(const TDesC &aFileName,
const TXmlEngParsingOptions &aOptions =  TXmlEngParsingOptions()
)[virtual]

Deserializes the given file. Any filename previously set with SetInputFileL() is ignored.

The result of deserialization is passed to the content handler as SAX events.

leave

  • One of the system wide error codes or one of the Xml specific ones defined in XmlFrameworkErrors.h

Parameters

const TDesC & aFileNameThe file to be parsed
const TXmlEngParsingOptions & aOptions =  TXmlEngParsingOptions()Parsing options

DeserializeL(RFs &, const TDesC &, const TXmlEngParsingOptions &)

IMPORT_C voidDeserializeL(RFs &aRFs,
const TDesC &aFileName,
const TXmlEngParsingOptions &aOptions =  TXmlEngParsingOptions()
)[virtual]

Deserializes the given file. Any filename previously set with SetInputFileL() is ignored.

The result of deserialization is passed to the content handler as SAX events.

leave

  • One of the system wide error codes or one of the Xml specific ones defined in XmlFrameworkErrors.h

Parameters

RFs & aRFsFile Server session
const TDesC & aFileNameThe file to be parsed
const TXmlEngParsingOptions & aOptions =  TXmlEngParsingOptions()Parsing options

DeserializeL(const TDesC8 &, const TXmlEngParsingOptions &)

IMPORT_C voidDeserializeL(const TDesC8 &aBuffer,
const TXmlEngParsingOptions &aOptions =  TXmlEngParsingOptions()
)[virtual]

Deserializes the given buffer. Any buffer previously set with SetInputBuffer() is ignored.

The result of deserialization is passed to the content handler as SAX events.

leave

  • One of the system wide error codes or one of the Xml specific ones defined in XmlFrameworkErrors.h

Parameters

const TDesC8 & aBufferThe buffer to be parsed
const TXmlEngParsingOptions & aOptions =  TXmlEngParsingOptions()Parsing options

DisableFeature(TInt)

IMPORT_C TIntDisableFeature(TIntaParserFeature)[virtual]

Disables parser features.

Xml::CParser::DisableFeature()

Xml::CParser::TParserFeature

KErrNone if successful, otherwise one of the system-wide error codes

Parameters

TInt aParserFeatureThe parser feature to disable

EnableFeature(TInt)

IMPORT_C TIntEnableFeature(TIntaParserFeature)[virtual]

Enables parser features.

Xml::CParser::EnableFeature()

Xml::CParser::TParserFeature

KErrNone if successful, otherwise one of the system-wide error codes

Parameters

TInt aParserFeatureThe parser feature to enable

ExternalData()

IMPORT_C RArray< TXmlEngDataContainer > *ExternalData()

Gets the list of external data containers. The list of data containers or NULL if no external data is registered

GetDataContainer(const TDesC8 &)

TXmlEngDataContainer *GetDataContainer(const TDesC8 &aCid)

Retrieves a pointer to the data container referenced by CID. The data container or NULL if no matching container is found

Parameters

const TDesC8 & aCidThe aCid corresponding to the data container required

IsFeatureEnabled(TInt)

IMPORT_C TBoolIsFeatureEnabled(TIntaParserFeature)const [virtual]

Checks if a parser feature is enabled.

Xml::CParser::IsFeatureEnabled()

Xml::CParser::TParserFeature

ETrue if feature is enabled, otherwise EFalse

Parameters

TInt aParserFeatureThe parser feature to check

NewL(Xml::MContentHandler &, TXmlEngDeserializerType)

IMPORT_C CXmlEngDeserializer *NewL(Xml::MContentHandler &aContentHandler,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)[static]

Creates a deserializer of the given type. Returns an instance of this class or a derived class.

The deserializer

leave

  • One of the system-wide error codes

Parameters

Xml::MContentHandler & aContentHandler
TXmlEngDeserializerType aType = EDeserializerDefaultDeserializer type

ParsingOptions()

IMPORT_C const TXmlEngParsingOptions &ParsingOptions()[virtual]

Gets the parsing options The parsing options

SetContentHandlerL(Xml::MContentHandler &)

IMPORT_C voidSetContentHandlerL(Xml::MContentHandler &aContentHandler)[virtual]

Sets the content handler which handles SAX events raised during deserialization. Clients must derive from Xml::MContentHandler in order to receive SAX callbacks.

leave

  • One of the system-wide error codes

Parameters

Xml::MContentHandler & aContentHandlerThe content handler

SetInputBuffer(const TDesC8 &)

IMPORT_C voidSetInputBuffer(const TDesC8 &aBuffer)

Sets the input type to buffer and saves the buffer for later deserialization.

Parameters

const TDesC8 & aBufferThe buffer to deserialize

SetInputFileL(const TDesC &)

IMPORT_C voidSetInputFileL(const TDesC &aFileName)

Sets the input type to file and saves the file name for later deserialization. leave

  • One of the system-wide error codes

Parameters

const TDesC & aFileNameThe file name of the file to deserialize

SetParsingOptions(TXmlEngParsingOptions &)

IMPORT_C voidSetParsingOptions(TXmlEngParsingOptions &aOptions)[virtual]

Sets parsing options used for deserialization.

Parameters

TXmlEngParsingOptions & aOptionsParsing options to set. A copy of the options is stored.

UseExternalDataL(RArray< TXmlEngDataContainer > &)

IMPORT_C voidUseExternalDataL(RArray< TXmlEngDataContainer > &aList)

Sets a list of data containers and indicates that the XML to be deserialized contains references (such as xop:include) to data stored outside the DOM tree.

Upon deserialization, the references are substituted with the matching data containers and returned via the content handler.

This often occurs when a multipart MIME message is received. The text XML content may be in one part, while the binary content is in another part. Each part containing binary content must be placed into a data container using RXmlEngDocument::CreateBinaryContainerL() or similar. When deserialization of the XML occurs, the data containers are retrieved by content-id.

Ownership is not transferred and the list must stay in scope for the lifetime of the deserializer.

leave

  • Any system-wide error code

Parameters

RArray< TXmlEngDataContainer > & aListThe list of data containers

Member Data Documentation

TPtrC8 iBuffer

TPtrC8 iBuffer[private]

Buffer to be parsed

RArray< TXmlEngDataContainer > * iDataList

RArray< TXmlEngDataContainer > *iDataList[private]

Array of external data

TUint iFeatures

TUint iFeatures[private]

Features

HBufC * iInputFileName

HBufC *iInputFileName[private]

File to be parsed

Xml::CParser * iParser

Xml::CParser *iParser[private]

SAX Parser

TXmlEngParsingOptions iParsingOptions

TXmlEngParsingOptions iParsingOptions[private]

Parsing options

TXmlEngDeserializationSource iSerializationOutput

TXmlEngDeserializationSource iSerializationOutput[private]

Deserialization format