CXmlEngDeserializerDOM Class Reference

#include <xml/dom/xmlengdeserializerdom.h>

class CXmlEngDeserializerDOM : public CBase

Inherits from

  • CXmlEngDeserializerDOM

Detailed Description

Deserializes a XML file to a DOM tree.

Sample code for deserialization to a DOM tree:
     // create deserializer
     CXmlEngDeserializerDOM* deserializer = CXmlEngDeserializerDOM::NewL();
     CleanupStack::PushL(deserializer);
     // configure deserializer
     deserializer->SetInputFileL(KInputFile, EDeserializerGZip);
     // Set the DOM Implementation
     deserializer->UseDOMImplementationL(iDomImpl);
     // deserialize
     RXmlEngDocument doc = deserializer->DeserializeL();
     CleanupStack::PopAndDestroy();// deserializer

Member Attribute Documentation

iBuffer

TPtrC8 iBuffer[protected]

Buffer to be parsed

iDataList

RArray< TXmlEngDataContainer > *iDataList[protected]

Array of external data

iImpl

RXmlEngDOMImplementation *iImpl[protected]

DOM implementation

iInputFileName

HBufC *iInputFileName[protected]

File to be parsed

iType

TXmlEngDeserializerType iType[protected]

Deserializer type

Constructor & Destructor Documentation

CXmlEngDeserializerDOM ( )

CXmlEngDeserializerDOM()[protected]

Default constructor.

~CXmlEngDeserializerDOM ( )

~CXmlEngDeserializerDOM()

Destructor.

Member Function Documentation

DeserializeL ( )

IMPORT_C RXmlEngDocumentDeserializeL()

Deserializes the file or buffer previously set by SetInputFileL() or SetInputBuffer() and creates a new document that holds the DOM tree.

Return Value
The document that holds the DOM tree
Leave Codes
KXmlEngErrNoParametersNo file or buffer has been previously set
KXmlEngErrWrongUseOfAPIDOM Implementation not set

DeserializeL ( const TDesC &, TXmlEngDeserializerType )

IMPORT_C RXmlEngDocumentDeserializeL(const TDesC &aFileName,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)

Deserializes the given file and creates a new document that holds the DOM tree. Any filename previously set with SetInputFileL() is ignored.

Parameters
aFileNameThe file to be deserialized
aTypeThe deserialization format
Return Value
The document that holds the DOM tree
Leave Codes
KXmlEngErrWrongUseOfAPIDOM Implementation not set

DeserializeL ( RFs &, const TDesC &, TXmlEngDeserializerType )

IMPORT_C RXmlEngDocumentDeserializeL(RFs &aRFs,
const TDesC &aFileName,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)

Deserializes the given file and creates a new document that holds the DOM tree. Any filename previously set with SetInputFileL() is ignored.

Parameters
aRFsFile Server session
aFileNameThe file to be deserialized
aTypeThe deserialization format
Return Value
The document that holds the DOM tree
Leave Codes
KXmlEngErrWrongUseOfAPIDOM Implementation not set

DeserializeL ( const TDesC8 &, TXmlEngDeserializerType )

IMPORT_C RXmlEngDocumentDeserializeL(const TDesC8 &aBuffer,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)

Deserializes the given buffer and creates a new document that holds the DOM tree. Any buffer previously set with SetInputBuffer() is ignored.

Parameters
aBufferBuffer to be parsed
aTypeInput type
Return Value
The document that holds the DOM tree
Leave Codes
KXmlEngErrWrongUseOfAPIDOM Implementation not set

ExternalData ( )

IMPORT_C RArray< TXmlEngDataContainer > *ExternalData()

Gets the list of external data containers.

Return Value
The list of data containers or NULL if no external data is registered

NewL ( )

IMPORT_C CXmlEngDeserializerDOM *NewL()[static]
Creates an instance of CXmlEngDeserializerDOM.
Return Value
The DOM deserializer instance
Leave Codes
KErrNoMemoryMemory allocation failure

SetInputBuffer ( const TDesC8 &, TXmlEngDeserializerType )

IMPORT_C voidSetInputBuffer(const TDesC8 &aBuffer,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)

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

Parameters
aBufferThe buffer to deserialize
aTypeThe deserialization format

SetInputFileL ( const TDesC &, TXmlEngDeserializerType )

IMPORT_C voidSetInputFileL(const TDesC &aFileName,
TXmlEngDeserializerTypeaType = EDeserializerDefault
)
Sets the input type to file and saves the file name for later deserialization.
Parameters
aFileNameThe file name of the file to deserialize
aTypeThe deserialization format
Leave Codes

UseDOMImplementationL ( RXmlEngDOMImplementation & )

IMPORT_C voidUseDOMImplementationL(RXmlEngDOMImplementation &aImpl)
Sets the DOM implementation that will be used to create the DOM tree
Parameters
aImplThe DOM implementation
Leave Codes

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.

Parameters
aListThe list of data containers
Leave Codes