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.

    leave
    KXmlEngErrNoParameters No file or buffer has been previously set
    leave
    KXmlEngErrWrongUseOfAPI DOM Implementation not set
    leave
    • One of the system-wide error codes

    Returns: The document that holds the DOM tree

    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.

    leave
    KXmlEngErrWrongUseOfAPI DOM Implementation not set
    leave
    • One of the system wide error codes

    ParameterDescription
    aFileNameThe file to be deserialized
    aTypeThe deserialization format

    Returns: The document that holds the DOM tree

    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.

    leave
    KXmlEngErrWrongUseOfAPI DOM Implementation not set
    leave
    • One of the system wide error codes

    ParameterDescription
    aRFsFile Server session
    aFileNameThe file to be deserialized
    aTypeThe deserialization format

    Returns: The document that holds the DOM tree

    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.

    leave
    KXmlEngErrWrongUseOfAPI DOM Implementation not set
    leave
    • One of the system wide error codes

    ParameterDescription
    aBufferBuffer to be parsed
    aTypeInput type

    Returns: The document that holds the DOM tree

    ExternalData ( )

    IMPORT_C RArray< TXmlEngDataContainer > *ExternalData()

    Gets the list of external data containers.

    Returns: The list of data containers or NULL if no external data is registered

    NewL ( )

    IMPORT_C CXmlEngDeserializerDOM *NewL()[static]
    Creates an instance of CXmlEngDeserializerDOM.
    leave
    KErrNoMemory Memory allocation failure

    Returns: The DOM deserializer instance

    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.

    ParameterDescription
    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.
    leave
    • One of the system-wide error codes

    ParameterDescription
    aFileNameThe file name of the file to deserialize
    aTypeThe deserialization format

    UseDOMImplementationL ( RXmlEngDOMImplementation & )

    IMPORT_C voidUseDOMImplementationL(RXmlEngDOMImplementation &aImpl)
    Sets the DOM implementation that will be used to create the DOM tree
    leave
    • Does not leave

    ParameterDescription
    aImplThe DOM implementation

    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

    ParameterDescription
    aListThe list of data containers