CXmlExample Class Reference

List of all members.

Public Member Functions

 ~CXmlExample ()
void OnStartDocumentL (const Xml::RDocumentParameters &aDocParam, TInt aErrorCode)
void OnEndDocumentL (TInt aErrorCode)
void OnStartElementL (const Xml::RTagInfo &aElement, const Xml::RAttributeArray &aAttributes, TInt aErrorCode)
void OnEndElementL (const Xml::RTagInfo &aElement, TInt aErrorCode)
void OnContentL (const TDesC8 &aBytes, TInt aErrorCode)
void OnStartPrefixMappingL (const RString &aPrefix, const RString &aUri, TInt aErrorCode)
void OnEndPrefixMappingL (const RString &aPrefix, TInt aErrorCode)
void OnIgnorableWhiteSpaceL (const TDesC8 &aBytes, TInt aErrorCode)
void OnSkippedEntityL (const RString &aName, TInt aErrorCode)
void OnProcessingInstructionL (const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode)
void OnError (TInt aErrorCode)
TAny * GetExtendedInterface (const TInt32 aUid)
void ParseExampleDocumentsL ()
HBufC * Copy8To16LC (const TDesC8 &aDes)

Static Public Member Functions

static CXmlExampleNewL ()

Public Attributes

TBool iLeaveOnStartElement
TInt iNumElements
TInt iNumSkippedEntities
TInt iNumPrefixMappings
TInt iNumPrefixUnmappings
TInt iError

Detailed Description

CXmlExample demonstrates the usage of the XML Framework to parse an XML and WBXML file.

CXmlExample implements the XML Framework's MContentHandler interface, which the parser calls to notify the application of parsing events, such as the start of elements.

Definition at line 31 of file xmlexample.h.


Constructor & Destructor Documentation

CXmlExample::~CXmlExample (  ) 

Destructor

Definition at line 92 of file xmlexample.cpp.


Member Function Documentation

CXmlExample * CXmlExample::NewL (  )  [static]

Allocates and constructs a CXmlExample object. Initialises all member data to their default values.

Definition at line 68 of file xmlexample.cpp.

void CXmlExample::OnEndDocumentL ( TInt  aErrorCode  ) 

A callback to indicate the end of the document.

Implementation of the pure virtual function of MContentHandler.

Parameters:
aErrorCode The error code. If aErrorCode is not KErrNone, the function leaves.

Definition at line 130 of file xmlexample.cpp.

void CXmlExample::OnContentL ( const TDesC8 &  aData8,
TInt  aErrorCode 
)

A callback that sends the content of the element and prints element content data to the console. Not all the content may be returned in one go. The data may be sent in chunks. When an OnEndElementL is received this means there is no more content to be sent.

Implementation of the pure virtual function of MContentHandler.

Parameters:
aData8 The raw content data for the element. The client is responsible for converting the data to the required character set if necessary. In some instances the content may be binary and must not be converted.
aErrorCode The error code. If aErrorCode is not KErrNone, the function leaves.

Definition at line 228 of file xmlexample.cpp.

void CXmlExample::OnStartPrefixMappingL ( const RString &  aPrefix,
const RString &  aUri,
TInt  aErrorCode 
)

A notification of the beginning of the scope of a prefix-URI Namespace mapping. Always called before the corresponding OnStartElementL method.

Implementation of the pure virtual function of MContentHandler.

Parameters:
aPrefix The Namespace prefix being declared.
aUri The Namespace URI the prefix is mapped to.
aErrorCode The error code. KErrNotSupported

Definition at line 300 of file xmlexample.cpp.

void CXmlExample::OnEndPrefixMappingL ( const RString &  aPrefix,
TInt  aErrorCode 
)

Notification of the end of the scope of a prefix-URI mapping.

Definition at line 319 of file xmlexample.cpp.

void CXmlExample::OnIgnorableWhiteSpaceL ( const TDesC8 &  aBytes,
TInt  aErrorCode 
)

A notification of ignorable whitespace in element content.

Definition at line 331 of file xmlexample.cpp.

void CXmlExample::OnSkippedEntityL ( const RString &  aName,
TInt  aErrorCode 
)

A notification of a skipped entity. If the parser encounters an external entity, it does not need to expand it - it can return the entity as aName for the client to deal with.

Implementation of the pure virtual function of MContentHandler.

Parameters:
aName Name of the skipped entity.
aErrorCode The error code. KErrNotSupported

Definition at line 347 of file xmlexample.cpp.

void CXmlExample::OnProcessingInstructionL ( const TDesC8 &  aTarget8,
const TDesC8 &  aData8,
TInt  aErrorCode 
)

A receive notification of a processing instruction. It prints the target and data to the console.

Implementation of the pure virtual function of MContentHandler.

Parameters:
aTarget The processing instruction target.
aData The processing instruction data. If empty, none was supplied.
aErrorCode The error code. If aErrorCode is not KErrNone, the function leaves.

Definition at line 252 of file xmlexample.cpp.

void CXmlExample::OnError ( TInt  aError  ) 

Implementation of the pure virtual function of MContentHandler. Indicates that an error has occurred.

Parameters:
aError The error code

Definition at line 272 of file xmlexample.cpp.

TAny * CXmlExample::GetExtendedInterface ( const TInt32  aUid  ) 

Obtain the interface matching the specified uid.

Definition at line 283 of file xmlexample.cpp.

void CXmlExample::ParseExampleDocumentsL (  ) 

Passes an XML and a WBXML file to the framework for parsing.

Definition at line 362 of file xmlexample.cpp.

HBufC * CXmlExample::Copy8To16LC ( const TDesC8 &  aDes  ) 

Copies 8 bit descriptor data to 16 bit descriptor KErrNoMemory, User 11

Definition at line 205 of file xmlexample.cpp.


Generated by  doxygen 1.6.2