class CMDXMLParser : public CActive |
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.
Public Member Functions | |
---|---|
~CMDXMLParser() | |
IMPORT_C CMDXMLDocument * | DetachXMLDoc() |
CMDXMLEntityConverter * | EntityConverter() |
IMPORT_C TInt | Error() |
IMPORT_C TXMLErrorCodeSeverity | ErrorSeverity() |
IMPORT_C CMDXMLParser * | NewL(MMDXMLParserObserver *) |
IMPORT_C CMDXMLParser * | NewL(MMDXMLParserObserver *, MXMLDtd *) |
IMPORT_C CMDXMLParser * | NewLC(MMDXMLParserObserver *) |
IMPORT_C CMDXMLParser * | NewLC(MMDXMLParserObserver *, MXMLDtd *) |
IMPORT_C TInt | ParseFile(RFs, const TDesC &) |
IMPORT_C TInt | ParseFile(RFile &) |
void | ParseSource(MMDXMLParserDataProvider *) |
IMPORT_C void | ParseSourceL(MMDXMLParserDataProvider *) |
IMPORT_C void | SetEntityConverter(CMDXMLEntityConverter *) |
IMPORT_C void | SetSourceCharacterWidth(TMDXMLParserInputCharWidth) |
IMPORT_C void | SetStoreInvalid(TBool) |
IMPORT_C void | SetWhiteSpaceHandlingMode(TBool) |
Public Member Enumerations | |
---|---|
enum | TMDXMLParserInputCharWidth { EAscii = 0x01, EUnicode = 0x02 } |
Private Member Enumerations | |
---|---|
enum | EParserStates { KInitFromFile, KDetermineCharset, KWaitingForData, KParseData, KSpanDataGap, KFinished } |
enum | TGetCharReturn { KError = 0x00, KCharReturned, KWaitForChar } |
enum | TPanicCode { ENullMemVarDataSource, ENullMemVarParserObserver, ENullMemVarXMLDoc, ENullMemVarElementTag, ENullParameterParentElement } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Inherited Attributes | |
---|---|
CActive::iStatus |
CMDXMLParser | ( | MMDXMLParserObserver * | aParserObserver | ) | [private] |
MMDXMLParserObserver * aParserObserver |
CMDXMLParser | ( | MMDXMLParserObserver * | aParserObserver, |
MXMLDtd * | aDtdRepresentation | ||
) | [private] |
MMDXMLParserObserver * aParserObserver | |
MXMLDtd * aDtdRepresentation |
void | AddTextL | ( | CMDXMLElement * | aParentElement | ) | [private] |
CMDXMLElement * aParentElement |
TBool | CDataSectionL | ( | CMDXMLElement * | aParentElement | ) | [private] |
CMDXMLElement * aParentElement |
void | CheckForErrors | ( | ) | [private] |
This should be called when parsing has been completed, before calling ParseFileCompleteL(). It checks for errors that can only be determined at the end of parsing, eg missing doctype or incomplete content.
TInt | CheckForStartCData | ( | const TDesC & | aTextToCheck | ) | [private] |
const TDesC & aTextToCheck |
TBool | CommentL | ( | CMDXMLElement * | aParentElement | ) | [private] |
CMDXMLElement * aParentElement |
void | ConstructL | ( | MXMLDtd * | aDtdRepresentation | ) | [private] |
MXMLDtd * aDtdRepresentation |
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.
IMPORT_C void | DoCancel | ( | ) | [private, virtual] |
Implements cancellation of an outstanding request.
This function is called as part of the active object's Cancel().
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel() must not wait for event completion; this is handled by Cancel().
IMPORT_C TXMLErrorCodeSeverity | ErrorSeverity | ( | ) | const |
Get the severity of the most severe error found.
TInt | FindDelimiter | ( | TDesC & | aDataToSearch, |
TDesC & | aDelimiterToFind | |||
) | [private] |
TGetCharReturn | GetDoubleByteChar | ( | TDes & | aChar | ) | [private] |
TDes & aChar |
TGetCharReturn | GetSingleByteChar | ( | TDes & | aChar | ) | [private] |
TDes & aChar |
TBool | InCDataSection | ( | TDesC & | aDataToSearch | ) | [private] |
TDesC & aDataToSearch |
TInt | LocateNextAttribute | ( | const TDesC & | aTagToParse | ) | [private] |
This function locates the next attribute in the tag.
const TDesC & aTagToParse | the tag to find the attribute in |
IMPORT_C CMDXMLParser * | NewL | ( | MMDXMLParserObserver * | aParserObserver | ) | [static] |
Allocates and constructs a new XML parser, specifying a DTD.
MMDXMLParserObserver * aParserObserver | XML parser observer |
IMPORT_C CMDXMLParser * | NewL | ( | MMDXMLParserObserver * | aParserObserver, |
MXMLDtd * | aDtdRepresentation | |||
) | [static] |
Allocates and constructs a new XML parser, specifying a DTD.
MMDXMLParserObserver * aParserObserver | XML parser observer |
MXMLDtd * aDtdRepresentation | DTD validator |
IMPORT_C CMDXMLParser * | NewLC | ( | MMDXMLParserObserver * | aParserObserver | ) | [static] |
Allocates and constructs a new XML parser, leaving the object on the cleanup stack.
MMDXMLParserObserver * aParserObserver | XML parser observer |
IMPORT_C CMDXMLParser * | NewLC | ( | MMDXMLParserObserver * | aParserObserver, |
MXMLDtd * | aDtdRepresentation | |||
) | [static] |
Allocates and constructs a new XML parser, leaving the object on the cleanup stack.
MMDXMLParserObserver * aParserObserver | XML parser observer |
MXMLDtd * aDtdRepresentation | DTD validator |
TInt | ParseElementAttributesL | ( | CMDXMLElement & | aElement, |
TDes & | aTagToParse | |||
) | [private] |
CMDXMLElement & aElement | |
TDes & aTagToParse |
TInt | ParseElementEndTag | ( | CMDXMLElement & | aElement, |
const TDesC & | aTagToParse | |||
) | [private] |
CMDXMLElement & aElement | |
const TDesC & aTagToParse |
IMPORT_C TInt | ParseFile | ( | RFs | aRFs, |
const TDesC & | aFileToParse | |||
) |
Parses a specified XML file into a DOM object tree.
IMPORT_C TInt | ParseFile | ( | 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.
RFile & aFileHandleToParse | An open file handle for the file to parse. Ownership of the file handle is passed. |
TInt | ParseSingleAttributeL | ( | TDes & | aAttributeValue | ) | [private] |
TDes & aAttributeValue |
void | ParseSource | ( | MMDXMLParserDataProvider * | aSource | ) | [inline] |
Parses a specified XML Data Source into a DOM object tree. Use ParseSourceL() function in preference to ParseSource()
MMDXMLParserDataProvider * aSource | MMDXMLParserDataProvider pointer |
IMPORT_C void | ParseSourceL | ( | MMDXMLParserDataProvider * | aSource | ) |
Parses a specified XML Data Source into a DOM object tree.
MMDXMLParserDataProvider * aSource | MMDXMLParserDataProvider pointer |
IMPORT_C void | PlaceholderForRemovedExport1 | ( | MMDXMLParserObserver * | aParserObserver | ) | [private] |
MMDXMLParserObserver * aParserObserver |
IMPORT_C void | PlaceholderForRemovedExport2 | ( | MMDXMLParserObserver * | aParserObserver, |
MXMLDtd * | aDtdRepresentation | |||
) | [private] |
MMDXMLParserObserver * aParserObserver | |
MXMLDtd * aDtdRepresentation |
TBool | ProcessingInstructionL | ( | CMDXMLElement * | aParentElement | ) | [private] |
CMDXMLElement * aParentElement |
void | RunL | ( | ) | [private, virtual] |
Handles an active object's request completion event.
A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.
The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.
Before calling this active object's RunL() function, the active scheduler has:
1. decided that this is the highest priority active object with a completed request
2. marked this active object's request as complete (i.e. the request is no longer outstanding)
RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.
Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.
CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD
IMPORT_C void | SetEntityConverter | ( | CMDXMLEntityConverter * | aEntityConverter | ) |
Sets the entity converter to be used for parsing. and take ownership of the passed entity converter
CMDXMLEntityConverter * aEntityConverter | the entity converter to be used. |
IMPORT_C void | SetError | ( | const TInt | aErrorCode, |
const TXMLErrorCodeSeverity | aSeverity | |||
) | [private] |
const TInt aErrorCode | |
const TXMLErrorCodeSeverity aSeverity |
IMPORT_C void | SetSourceCharacterWidth | ( | TMDXMLParserInputCharWidth | aWidth | ) |
Sets the input stream character width.
TMDXMLParserInputCharWidth aWidth | Character width for incoming stream. Possible values are EAscii and EUnicode (representing Ascii/UTF8 and Unicode respectively). |
IMPORT_C void | SetStoreInvalid | ( | TBool | aStoreInvalid | ) |
Controls whether invalid elements and attributes are added to the DOM.
TBool aStoreInvalid | ETrue if invalid content should be stored, EFalse otherwise. |
IMPORT_C void | SetWhiteSpaceHandlingMode | ( | TBool | aPreserve | ) |
Controls whether whitespaces are handled by XML parser or by client.
TBool aPreserve | ETrue if all whitespaces should be preserved (handled by client), EFalse otherwise. |
KInitFromFile | |
KDetermineCharset | |
KWaitingForData | |
KParseData | |
KSpanDataGap | |
KFinished |
Defines input stream character widths.
EAscii = 0x01 | |
EUnicode = 0x02 |
ENullMemVarDataSource | |
ENullMemVarParserObserver | |
ENullMemVarXMLDoc | |
ENullMemVarElementTag | |
ENullParameterParentElement |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.