CMDXMLParser Class Reference

#include <gmxmlparser.h>

Link against: xmlparser.lib

class CMDXMLParser : public CActive

Inherits from

  • CMDXMLParser

    Detailed Description

    Creates a DOM structure from a given XML file.

    The parsing operation is asynchronous and is initiated by a call to ParseFile(). On completion, the created DOM document can be retrieved through DetachXMLDoc().

    Note the following ownership rules for the DOM document:

    1. calling DetachXMLDoc() transfers ownership of the document to the client

    2. if the parser is asked to parse a new file while it still owns an existing DOM document, it will delete the old document.

    Member Enumeration Documentation

    Enum TMDXMLParserInputCharWidth

    Defines input stream character widths.

    EnumeratorValueDescription
    EAscii0x01
    EUnicode0x02

    Constructor & Destructor Documentation

    ~CMDXMLParser ( )

    IMPORT_C~CMDXMLParser()

    Destructor.

    Member Function Documentation

    DetachXMLDoc ( )

    IMPORT_C CMDXMLDocument *DetachXMLDoc()

    Gets the created DOM.

    This should be called after the conclusion of the parser process.

    Note that the function sets the internal variable pointing to the document to NULL, so this function can only be called once per file parse. The caller takes ownership of the document, and must delete it when its use is complete.

    Returns: The created DOM

    EntityConverter ( )

    CMDXMLEntityConverter *EntityConverter()

    Gets the entity converter.

    Returns: The entity converter

    Error ( )

    IMPORT_C TIntError()const

    Gets the last error found by the parser.

    Returns: Error code

    ErrorSeverity ( )

    IMPORT_C TXMLErrorCodeSeverityErrorSeverity()const

    Get the severity of the most severe error found.

    Returns: the maximum error severity

    NewL ( MMDXMLParserObserver * )

    IMPORT_C CMDXMLParser *NewL(MMDXMLParserObserver *aParserObserver)[static]

    Allocates and constructs a new XML parser, specifying a DTD.

    leave
    KErrNoMemory Out of memory
    ParameterDescription
    aParserObserverXML parser observer

    Returns: New XML parser

    NewL ( MMDXMLParserObserver *, MXMLDtd * )

    IMPORT_C CMDXMLParser *NewL(MMDXMLParserObserver *aParserObserver,
    MXMLDtd *aDtdRepresentation
    )[static]

    Allocates and constructs a new XML parser, specifying a DTD.

    leave
    KErrNoMemory Out of memory
    ParameterDescription
    aParserObserverXML parser observer
    aDtdRepresentationDTD validator

    Returns: New XML parser

    NewLC ( MMDXMLParserObserver * )

    IMPORT_C CMDXMLParser *NewLC(MMDXMLParserObserver *aParserObserver)[static]

    Allocates and constructs a new XML parser, leaving the object on the cleanup stack.

    leave
    KErrNoMemory Out of memory
    ParameterDescription
    aParserObserverXML parser observer

    Returns: New XML parser

    NewLC ( MMDXMLParserObserver *, MXMLDtd * )

    IMPORT_C CMDXMLParser *NewLC(MMDXMLParserObserver *aParserObserver,
    MXMLDtd *aDtdRepresentation
    )[static]

    Allocates and constructs a new XML parser, leaving the object on the cleanup stack.

    leave
    KErrNoMemory Out of memory
    ParameterDescription
    aParserObserverXML parser observer
    aDtdRepresentationDTD validator

    Returns: New XML parser

    ParseFile ( RFs, const TDesC & )

    IMPORT_C TIntParseFile(RFsaRFs,
    const TDesC &aFileToParse
    )

    Parses a specified XML file into a DOM object tree.

    ParameterDescription
    aRFsFile server session
    aFileToParseThe file name to parse

    Returns: KErrNone if success or a file read error code

    ParseFile ( RFile & )

    IMPORT_C TIntParseFile(RFile &aFileHandleToParse)

    Parses a specified XML file into a DOM object tree.

    Parses a specified XML file into a DOM object tree using an open file handle. The parser takes ownership of the open file handle and will close handle when completed.

    ParameterDescription
    aFileHandleToParseAn open file handle for the file to parse. Ownership of the file handle is passed.

    Returns: KErrNone if successful.

    ParseSource ( MMDXMLParserDataProvider * )

    voidParseSource(MMDXMLParserDataProvider *aSource)[inline]

    Parses a specified XML Data Source into a DOM object tree. Use ParseSourceL() function in preference to ParseSource()

    ParameterDescription
    aSourceMMDXMLParserDataProvider pointer

    ParseSourceL ( MMDXMLParserDataProvider * )

    IMPORT_C voidParseSourceL(MMDXMLParserDataProvider *aSource)

    Parses a specified XML Data Source into a DOM object tree.

    ParameterDescription
    aSourceMMDXMLParserDataProvider pointer

    SetEntityConverter ( CMDXMLEntityConverter * )

    IMPORT_C voidSetEntityConverter(CMDXMLEntityConverter *aEntityConverter)

    Sets the entity converter to be used for parsing. and take ownership of the passed entity converter

    ParameterDescription
    aEntityConverterthe entity converter to be used.

    SetSourceCharacterWidth ( TMDXMLParserInputCharWidth )

    IMPORT_C voidSetSourceCharacterWidth(TMDXMLParserInputCharWidthaWidth)

    Sets the input stream character width.

    ParameterDescription
    aWidthCharacter width for incoming stream. Possible values are EAscii and EUnicode (representing Ascii/UTF8 and Unicode respectively).

    SetStoreInvalid ( TBool )

    IMPORT_C voidSetStoreInvalid(TBoolaStoreInvalid)

    Controls whether invalid elements and attributes are added to the DOM.

    ParameterDescription
    aStoreInvalidETrue if invalid content should be stored, EFalse otherwise.

    SetWhiteSpaceHandlingMode ( TBool )

    IMPORT_C voidSetWhiteSpaceHandlingMode(TBoolaPreserve)

    Controls whether whitespaces are handled by XML parser or by client.

    ParameterDescription
    aPreserveETrue if all whitespaces should be preserved (handled by client), EFalse otherwise.