CSenXmlReader Class Reference

class CSenXmlReader : public CBase
Class extends Symbian XML framework parser functionality Callers of this class must register some handler which will then receive XML callback events from underlying Symbian XML framework. SenXML.dll
Since
Series60 3.0

Inherits from

Public Member Functions
~CSenXmlReader()
IMPORT_C TIntEnabledParserFeature()
TAny *GetExtendedInterface(const TInt32)
IMPORT_C CSenXmlReader *NewL()
IMPORT_C CSenXmlReader *NewL(TInt)
IMPORT_C CSenXmlReader *NewL(const TDesC8 &)
IMPORT_C CSenXmlReader *NewL(const TDesC8 &, TInt)
IMPORT_C CSenXmlReader *NewLC()
IMPORT_C CSenXmlReader *NewLC(TInt)
IMPORT_C CSenXmlReader *NewLC(const TDesC8 &)
IMPORT_C CSenXmlReader *NewLC(const TDesC8 &, TInt)
voidOnContentL(const TDesC8 &, TInt)
voidOnEndDocumentL(TInt)
voidOnEndElementL(const RTagInfo &, TInt)
voidOnEndPrefixMappingL(const RString &, TInt)
voidOnError(TInt)
voidOnIgnorableWhiteSpaceL(const TDesC8 &, TInt)
voidOnProcessingInstructionL(const TDesC8 &, const TDesC8 &, TInt)
voidOnSkippedEntityL(const RString &, TInt)
voidOnStartDocumentL(const RDocumentParameters &, TInt)
voidOnStartElementL(const RTagInfo &, const RAttributeArray &, TInt)
voidOnStartPrefixMappingL(const RString &, const RString &, TInt)
IMPORT_C voidParseL(const TDesC8 &)
IMPORT_C voidParseL(RFs &, const TDesC &)
IMPORT_C TIntParserFeature()
IMPORT_C voidSetContentHandler(MSenContentHandlerClient &)
TInt SetParserFeature(TInt)
Protected Member Functions
CSenXmlReader(TInt)
voidConstructL(const TDesC8 &)
voidRecreateParserL()
Private Member Functions
voidCleanUp()
voidCleanupParser(TAny *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
MSenContentHandlerClient *iContentHandler
TInt iEnabledFeature
CParser *iParser
RStringPool iStringPool
CDesC8Array *ipNsPrefixes
CDesC8Array *ipNsUris

Constructor & Destructor Documentation

CSenXmlReader(TInt)

IMPORT_CCSenXmlReader(TIntaParserFeature)[protected]

C++ constructor.

Parameters

TInt aParserFeature

~CSenXmlReader()

IMPORT_C~CSenXmlReader()[virtual]

Destructor.

Member Functions Documentation

CleanUp()

voidCleanUp()[private]

CleanupParser(TAny *)

voidCleanupParser(TAny *apReader)[private, static]

Parameters

TAny * apReader

ConstructL(const TDesC8 &)

voidConstructL(const TDesC8 &aParserMimeType)[protected]

Symbian 2nd phase constructor.

Parameters

const TDesC8 & aParserMimeTypesets the MIME type of this XML parser.

EnabledParserFeature()

IMPORT_C TIntEnabledParserFeature()[virtual]
Method for checking which feature has been enabled in the parser.
Since
Series60 3.0

GetExtendedInterface(const TInt32)

TAny *GetExtendedInterface(const TInt32aUid)[virtual]
This method obtains the interface matching the specified UID.
Since
Series60 3.0

Parameters

const TInt32 aUidthe UID identifying the required interface.

NewL()

IMPORT_C CSenXmlReader *NewL()[static]
Standard two-phase constructor. Creates new parser instance using default MIME type "text/xml" (KXmlParserMimeType).
Since
Series60 3.0

NewL(TInt)

IMPORT_C CSenXmlReader *NewL(TIntaParserFeature)[static]
A constructor with parser feature enabling. Uses default parser MIME type "text/xml" (KXmlParserMimeType).
Since
Series60 3.0

Parameters

TInt aParserFeatureis typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.

NewL(const TDesC8 &)

IMPORT_C CSenXmlReader *NewL(const TDesC8 &aParserMimeType)[static]
A constructor with parser MIME type. Standard two-phase constructor.
Since
Series60 3.0

Parameters

const TDesC8 & aParserMimeTypeis the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.

NewL(const TDesC8 &, TInt)

IMPORT_C CSenXmlReader *NewL(const TDesC8 &aParserMimeType,
TIntaParserFeature
)[static]
A constructor with parser MIME type and parser feature enabling.
Since
Series60 3.0

Parameters

const TDesC8 & aParserMimeType
TInt aParserFeatureis typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.

NewLC()

IMPORT_C CSenXmlReader *NewLC()[static]
Standard two-phase constructor. Creates new parser instance using default MIME type "text/xml" (KXmlParserMimeType).
Since
Series60 3.0

NewLC(TInt)

IMPORT_C CSenXmlReader *NewLC(TIntaParserFeature)[static]
A constructor with parser feature enabling. Uses default parser MIME type "text/xml" (KXmlParserMimeType).
Since
Series60 3.0

Parameters

TInt aParserFeatureis typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.

NewLC(const TDesC8 &)

IMPORT_C CSenXmlReader *NewLC(const TDesC8 &aParserMimeType)[static]
A constructor with parser MIME type.
Since
Series60 3.0

Parameters

const TDesC8 & aParserMimeTypeis the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.

NewLC(const TDesC8 &, TInt)

IMPORT_C CSenXmlReader *NewLC(const TDesC8 &aParserMimeType,
TIntaParserFeature
)[static]
A constructor with parser MIME type and parser feature enabling.
Since
Series60 3.0

Parameters

const TDesC8 & aParserMimeTypeis the XML parser MIME type. If descriptor is of zero-length, then default MIME type KXmlParserMimeType is used ("text/xml"). Availability of other MIME types depends on underlying parser implementation.
TInt aParserFeatureis typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation. Leave codes: KErrArgument if aParserFeature value is negative.

OnContentL(const TDesC8 &, TInt)

voidOnContentL(const TDesC8 &aBytes,
TIntaErrorCode
)[virtual]
Since
Series60 3.0

Parameters

const TDesC8 & aBytesis the actual XML data, content in UTF-8 form
TInt aErrorCodeKErrNone, or some system-wide error code if an error has occured.

OnEndDocumentL(TInt)

voidOnEndDocumentL(TIntaErrorCode)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

TInt aErrorCode

OnEndElementL(const RTagInfo &, TInt)

voidOnEndElementL(const RTagInfo &aElement,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RTagInfo & aElement
TInt aErrorCode

OnEndPrefixMappingL(const RString &, TInt)

voidOnEndPrefixMappingL(const RString &aPrefix,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RString & aPrefix
TInt aErrorCode

OnError(TInt)

voidOnError(TIntaErrorCode)[virtual]

OnError is a callback method signalled by Symbian XML framework. Current implementation of this class issues a leave in original ParseL() call on any received by this callback implementation. Used leave code will be the received error code.

Since
Series60 3.0
Currently any s

If content handler was not set, ParseL will leaves with KErrSenXmlContentHandlerNotSet.

Parameters

TInt aErrorCodeis one of the Symbian XML framework errors listed in XmlFrameworkErrors.h

OnIgnorableWhiteSpaceL(const TDesC8 &, TInt)

voidOnIgnorableWhiteSpaceL(const TDesC8 &aBytes,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const TDesC8 & aBytes
TInt aErrorCode

OnProcessingInstructionL(const TDesC8 &, const TDesC8 &, TInt)

voidOnProcessingInstructionL(const TDesC8 &aTarget,
const TDesC8 &aData,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const TDesC8 & aTarget
const TDesC8 & aData
TInt aErrorCode

OnSkippedEntityL(const RString &, TInt)

voidOnSkippedEntityL(const RString &aName,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RString & aName
TInt aErrorCode

OnStartDocumentL(const RDocumentParameters &, TInt)

voidOnStartDocumentL(const RDocumentParameters &aDocParam,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RDocumentParameters & aDocParam
TInt aErrorCode

OnStartElementL(const RTagInfo &, const RAttributeArray &, TInt)

voidOnStartElementL(const RTagInfo &aElement,
const RAttributeArray &aAttributes,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RTagInfo & aElement
const RAttributeArray & aAttributes
TInt aErrorCode

OnStartPrefixMappingL(const RString &, const RString &, TInt)

voidOnStartPrefixMappingL(const RString &aPrefix,
const RString &aUri,
TIntaErrorCode
)[virtual]
Since
Series60 3.0 Leave codes: KErrSenXmlContentHandlerNotSet if XML content handler for this XML reader has not been set. This leave can be avoided calling SetContentHandlerL() method prior parsing some XML document.

Parameters

const RString & aPrefix
const RString & aUri
TInt aErrorCode

ParseL(const TDesC8 &)

IMPORT_C voidParseL(const TDesC8 &aBuff)
Parse an XML buffer.
Since
Series60 3.0

Parameters

const TDesC8 & aBuffBuffer containing document to parse. Note that this method will also leave, if an error is returned from Symbian XML framework. Here are the corresponding enums, and their respective error code values (-1000, -999... and up) (XML-specific errors returned by the XML parser) [from XmlParserErrors.h] EXmlParserError = -1000, EXmlSyntax = 2+EXmlParserError, // -998 EXmlNoElements, // -997 EXmlInvalidToken, // -996 EXmlUnclosedToken, // -995 EXmlPartialChar, // -994 EXmlTagMismatch, // -993 EXmlDuplicateAttribute, // -992 EXmlJunkAfterDocElement, // -991 EXmlPeRef, // -990 EXmlUndefinedEntity, // -989 EXmlRecursiveEntity, // -988 EXmlAsyncEntity, // -987 EXmlBadCharRef, // -986 EXmlBinaryEntityRef, // -985 EXmlAttributeExternalEntityRef, // -984 EXmlMisplacedPi, // -983 EXmlUnknownEncoding, // -982 EXmlIncorrectEncoding, // -981 EXmlUnclosedCdata, // -980 EXmlExternalEntityHandling, // -979 EXmlNotStandalone, // -978 EXmlUnexpectedState, // -977 EXmlEntityDeclInPe, // -976 EXmlDtdRequired, // -975 EXmlFeatureLockedWhileParsing // -974

ParseL(RFs &, const TDesC &)

IMPORT_C voidParseL(RFs &aRFs,
const TDesC &aFileToParse
)
Parse an XML document.
Since
Series60 3.0

Parameters

RFs & aRFsAn open filesession.
const TDesC & aFileToParseFilename of file to parse.

ParserFeature()

IMPORT_C TIntParserFeature()[virtual]

RecreateParserL()

voidRecreateParserL()[protected]
This method re-initializes encapsulated CParser class instance.
Since
Series60 3.0

SetContentHandler(MSenContentHandlerClient &)

IMPORT_C voidSetContentHandler(MSenContentHandlerClient &aContentHandler)[virtual]
Method to allow client to register a content event handler (for XML) for the current reader.
Since
Series60 3.0

Parameters

MSenContentHandlerClient & aContentHandlerThe new event handler.

SetParserFeature(TInt)

TInt SetParserFeature(TIntaParserFeature)
Method for enabling a parser feature.
Since
Series60 3.0

Parameters

TInt aParserFeatureis typically some enumeration introduced in Xml::TParserFeature or some other feature introduced in some XML parser implementation.

Member Data Documentation

MSenContentHandlerClient * iContentHandler

MSenContentHandlerClient *iContentHandler[private]

TInt iEnabledFeature

TInt iEnabledFeature[private]

CParser * iParser

CParser *iParser[private]

RStringPool iStringPool

RStringPool iStringPool[private]

CDesC8Array * ipNsPrefixes

CDesC8Array *ipNsPrefixes[private]

CDesC8Array * ipNsUris

CDesC8Array *ipNsUris[private]