class Xml::CParser : public CBase |
If you need to parse xml this is the class you need to use.
Default plain-text XML parser plug-in supports following character set encodings:
ISO_8859_1 US_ASCII UTF_8 UTF_16 UTF_16BE UTF_16LE
Public Member Functions | |
---|---|
~CParser () | |
IMPORT_C void | AddPreloadedDictionaryL (const TDesC8 &) |
IMPORT_C TInt | DisableFeature ( TInt ) |
IMPORT_C TInt | EnableFeature ( TInt ) |
IMPORT_C TBool | IsFeatureEnabled ( TInt ) |
IMPORT_C CParser * | NewL (const TDesC8 &, MContentHandler &) |
IMPORT_C CParser * | NewL (const CMatchData &, MContentHandler &) |
IMPORT_C CParser * | NewLC (const TDesC8 &, MContentHandler &) |
IMPORT_C CParser * | NewLC (const CMatchData &, MContentHandler &) |
IMPORT_C void | ParseBeginL () |
IMPORT_C void | ParseBeginL (const TDesC8 &) |
IMPORT_C void | ParseBeginL (const CMatchData &) |
IMPORT_C void | ParseEndL () |
IMPORT_C void | ParseL (const TDesC8 &) |
IMPORT_C void | SetProcessorChainL (const RContentProcessorUids &) |
IMPORT_C RStringDictionaryCollection & | StringDictionaryCollection () |
IMPORT_C RStringPool & | StringPool () |
Private Member Functions | |
---|---|
CParser () | |
void | ConstructL (const TDesC8 &, MContentHandler &) |
void | ConstructL (const CMatchData &, MContentHandler &) |
Private Attributes | |
---|---|
TParserImpl * | iImpl |
IMPORT_C void | AddPreloadedDictionaryL | ( | const TDesC8 & | aPublicId | ) |
This method preloads a string dictionary prior to parsing.
const TDesC8 & aPublicId | the public identifier representing the document dtd. |
void | ConstructL | ( | const TDesC8 & | aParserMimeType, |
MContentHandler & | aCallback | |||
) | [private] |
This method constructs the object with default settings
const TDesC8 & aParserMimeType | Parser Mime type |
MContentHandler & aCallback | Event handler |
void | ConstructL | ( | const CMatchData & | aMatchData, |
MContentHandler & | aCallback | |||
) | [private] |
This method constructs the object according to the details specified in CMatchData object
const CMatchData & aMatchData | Detailed parser information |
MContentHandler & aCallback | Event handler |
IMPORT_C TInt | DisableFeature | ( | TInt | aParserFeature | ) |
This method disables a specific feature of the parser.
TParserFeature
TInt aParserFeature | The parser feature that must be disabled. |
IMPORT_C TInt | EnableFeature | ( | TInt | aParserFeature | ) |
This method enables a specific feature of the parser.
TParserFeature
TInt aParserFeature | The parser feature that must be enabled. |
IMPORT_C TBool | IsFeatureEnabled | ( | TInt | aParserFeature | ) | const |
This method tell whether a specific feature of the parser is enabled. TParserFeature
TInt aParserFeature |
IMPORT_C CParser * | NewL | ( | const TDesC8 & | aParserMimeType, |
MContentHandler & | aCallback | |||
) | [static] |
This method creates a parser that is ready to parse documents of the specified mime type.
If there are multiple parser plugins in the system which can parse the mime type, the XML framework will choose a parser.
The criteria used to choose a parser, from many matching parsers, is as follows:
A Symbian-supplied parser (with variant field set to "Symbian") will be selected by default. If there are multiple Symbian-supplied parsers, the one with the lowest Uid will be selected. Otherwise, the non-Symbian parser with the lowest Uid will be selected.
const TDesC8 & aParserMimeType | The mime type of the documents to parse (e.g. "txt/xml"). |
MContentHandler & aCallback | The handler for parser generated events. |
IMPORT_C CParser * | NewL | ( | const CMatchData & | aCriteria, |
MContentHandler & | aCallback | |||
) | [static] |
This method creates the particular parser specified in CMatchData parameter.
The parser plugin resolution process is based on mime type and variant field. Both are provided in CMatchData parameter. Mime Type is a mandatory string for the resolution process and it is matched against the data field of plugin resource files. Variant string is optional. If it exists, it is matched against the first entry of the opaque data field of plugin resource files.
If the query is narrowed down to many parsers, the XML framework might either leave with an error (KErrXmlMoreThanOneParserMatched), or choose a parser. The behaviour is specified by LeaveOnMany flag. The default value of the flag is FALSE ('choose a parser' behaviour).
The criteria used to choose a parser, from many matching parsers, is as follows:
If the optional Variant field is specified, the XML framework will choose the parser with the lowest Uid from the list.
If the optional Variant field is not specified, a Symbian-supplied parser (with variant field set to "Symbian") will be selected by default. If there are multiple Symbian-supplied parsers, the one with the lowest Uid will be selected. Otherwise, the non-Symbian parser with the lowest Uid will be selected.
Case sensitivity of the string matching process is applied according to the relevant flag in CMatchData. The default value is TRUE (Case Sensitivity enabled).
Only ROM-based parsers are returned if the relevant flag is set in CMatchData. The default value is FALSE (all parsers are considered).
const CMatchData & aCriteria | The specific information about required parser (mime type, variant data). |
MContentHandler & aCallback | The xml/wbxml event handler. |
IMPORT_C CParser * | NewLC | ( | const TDesC8 & | aParserMimeType, |
MContentHandler & | aCallback | |||
) | [static] |
This method is similar to NewL, but leaves the created parser on the cleanup stack.
const TDesC8 & aParserMimeType | The mime type of the documents to parse (e.g. "txt/xml"). |
MContentHandler & aCallback | The handler for parser generated events. |
IMPORT_C CParser * | NewLC | ( | const CMatchData & | aCriteria, |
MContentHandler & | aCallback | |||
) | [static] |
This method creates the particular parser specified in CMatchData parameter. It performs the same way as NewL with the exception that it leaves the object on the cleanup stack.
const CMatchData & aCriteria | The specific information about required parser (mime type, version, variant data). |
MContentHandler & aCallback | The xml/wbxml event handler. |
IMPORT_C void | ParseBeginL | ( | ) |
This method tells the parser that we're going to start parsing a document using the default mime type specified on construction.
The processor chain and features will be cleared if the parser currently set is not the default, all old features are removed as these generally have no meaning between parsers.
IMPORT_C void | ParseBeginL | ( | const TDesC8 & | aDocumentMimeType | ) |
This method tells the parser that we're going to start parsing a document using the parser associated with this mime type.
const TDesC8 & aDocumentMimeType | the mime type of the document |
IMPORT_C void | ParseBeginL | ( | const CMatchData & | aCriteria | ) |
This method tells the parser that we're going to start parsing a document using the parser associated with given CMatchData criteria.
const CMatchData & aCriteria | The specific information about required parser (mime type, version, variant data). |
IMPORT_C void | ParseEndL | ( | ) |
IMPORT_C void | ParseL | ( | const TDesC8 & | aFragment | ) |
This method tells the parser to parse a fragment of a document. Could be the whole document. ParseEndL should be called once the whole document has been parsed.
The parser currently set will be used.
const TDesC8 & aFragment | the fragment to parse |
IMPORT_C void | SetProcessorChainL | ( | const RContentProcessorUids & | aPlugins | ) |
This method changes the client and plugin chain.
const RContentProcessorUids & aPlugins | a list of plugin implementation uids that make up the callback chain. |
IMPORT_C RStringDictionaryCollection & | StringDictionaryCollection | ( | ) |
This method obtains a handle to the current StringDictionaryCollection.
IMPORT_C RStringPool & | StringPool | ( | ) |
This method obtains a handle to the current string pool.
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.