// --------------------------------------------------------------------------
// XmlHandler.h
//
// Copyright 2007, Antony Pranata
// http://www.antonypranata.com
//
// Example how to parse XML file using SAX on Symbian OS.
//
// There are two methods to parse XML document, i.e.;
// - StartParsingL() -> parse XML document without active object.
// The whole file content is read at once. It is simple, but suitable
// for relatively small file only.
// - StartParsingWithAoL() -> parse XML document with active object.
// --------------------------------------------------------------------------
// XmlHandler.h
//
// Copyright 2007, Antony Pranata
// http://www.antonypranata.com
//
// Example how to parse XML file using SAX on Symbian OS.
//
// There are two methods to parse XML document, i.e.;
// - StartParsingL() -> parse XML document without active object.
// The whole file content is read at once. It is simple, but suitable
// for relatively small file only.
// - StartParsingWithAoL() -> parse XML document with active object.
// --------------------------------------------------------------------------
#ifndef __XMLHANDLER_H__
#define __XMLHANDLER_H__
#define __XMLHANDLER_H__
// INCLUDE FILES
#include <e32base.h>
#include <xml/contenthandler.h> // for MContentHandler
#include <xml/parser.h> // for CParser
#include <e32base.h>
#include <xml/contenthandler.h> // for MContentHandler
#include <xml/parser.h> // for CParser
// CLASS DECLARATION
using namespace Xml;
#include "XML_Data.h"
#include "TXMLDataType.h"
/**
* MXmlHandlerObserver, an observer to CXmlHandler class.
*/
class MXmlHandlerObserver
{
#include "XML_Data.h"
#include "TXMLDataType.h"
/**
* MXmlHandlerObserver, an observer to CXmlHandler class.
*/
class MXmlHandlerObserver
{
public:
virtual void OnParseCompleted( TInt aError,RPointerArray <XML_Data> &aXMLDataArray, RPointerArray <TXMLDataType> aXMLDataTypeArray, TInt aNum) = 0;
virtual void OnParseCompleted( TInt aError,RPointerArray <XML_Data> &aXMLDataArray, RPointerArray <TXMLDataType> aXMLDataTypeArray, TInt aNum) = 0;
};
/**
* CXmlHandler, a class to parse XML file and then output log information
* to a buffer.
*/
class CXmlHandler: public CActive, MContentHandler
{
enum TState
{
EIdle,
EReadingFile
};
public: // Constructors and destructor
static CXmlHandler* NewL( MXmlHandlerObserver& aObserver );
static CXmlHandler* NewLC( MXmlHandlerObserver& aObserver );
virtual ~CXmlHandler();
public: // Public methods
* CXmlHandler, a class to parse XML file and then output log information
* to a buffer.
*/
class CXmlHandler: public CActive, MContentHandler
{
enum TState
{
EIdle,
EReadingFile
};
public: // Constructors and destructor
static CXmlHandler* NewL( MXmlHandlerObserver& aObserver );
static CXmlHandler* NewLC( MXmlHandlerObserver& aObserver );
virtual ~CXmlHandler();
public: // Public methods
void StartParsingL( const TDesC& aFileName );
void StartParsingWithAoL( const TDesC& aFileName , TInt aNum);
TPtr DisplayResult()
{ return iDisplayResult->Des(); }
void StartParsingWithAoL( const TDesC& aFileName , TInt aNum);
TPtr DisplayResult()
{ return iDisplayResult->Des(); }
private: // Constructors
CXmlHandler( MXmlHandlerObserver& aObserver );
void ConstructL();
void ConstructL();
private: // from CActive
void DoCancel();
void RunL();
TBuf8<20> iBuf;
private: // from MContentHandler
void DoCancel();
void RunL();
TBuf8<20> iBuf;
private: // from MContentHandler
void OnStartDocumentL( const RDocumentParameters &aDocParam, TInt aErrorCode );
void OnEndDocumentL( TInt aErrorCode );
void OnStartElementL( const RTagInfo &aElement, const RAttributeArray &aAttributes,
TInt aErrorCode );
void OnEndElementL( const 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 );
public:
void Reset();
HBufC* GetSysnewText(){return iSysnewText;}
private: // Private data
TInt iLength;
MXmlHandlerObserver& iObserver;
CParser* iParser;
HBufC8* iBuffer;
HBufC* iDisplayResult;
TState iState;
RFile iFile;
RPointerArray <XML_Data> iXMLDataArray;
RPointerArray <TXMLDataType> iXMLDataTypeArray;
XML_Data *iXMLData;
TXMLDataType *iXMLDataType;
TBool iFlag;
HBufC* iSysnewText;
TInt iNum;
};
void OnEndDocumentL( TInt aErrorCode );
void OnStartElementL( const RTagInfo &aElement, const RAttributeArray &aAttributes,
TInt aErrorCode );
void OnEndElementL( const 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 );
public:
void Reset();
HBufC* GetSysnewText(){return iSysnewText;}
private: // Private data
TInt iLength;
MXmlHandlerObserver& iObserver;
CParser* iParser;
HBufC8* iBuffer;
HBufC* iDisplayResult;
TState iState;
RFile iFile;
RPointerArray <XML_Data> iXMLDataArray;
RPointerArray <TXMLDataType> iXMLDataTypeArray;
XML_Data *iXMLData;
TXMLDataType *iXMLDataType;
TBool iFlag;
HBufC* iSysnewText;
TInt iNum;
};
#endif /* __XMLHANDLER_H__ */
// End of File
// --------------------------------------------------------------------------
// XmlHandler.cpp
//
// Copyright 2007, Antony Pranata
// http://www.antonypranata.com
//
// Example how to parse XML file using SAX on Symbian OS.
//
// There are two methods to parse XML document, i.e.;
// - StartParsingL() -> parse XML document without active object.
// The whole file content is read at once. It is simple, but suitable
// for relatively small file only.
// - StartParsingWithAoL() -> parse XML document with active object.
// --------------------------------------------------------------------------
// XmlHandler.cpp
//
// Copyright 2007, Antony Pranata
// http://www.antonypranata.com
//
// Example how to parse XML file using SAX on Symbian OS.
//
// There are two methods to parse XML document, i.e.;
// - StartParsingL() -> parse XML document without active object.
// The whole file content is read at once. It is simple, but suitable
// for relatively small file only.
// - StartParsingWithAoL() -> parse XML document with active object.
// --------------------------------------------------------------------------
// INCLUDE FILES
#include <coemain.h>
#include <f32file.h>
#include "XmlHandler.h"
#include <aknnotewrappers.h>
#include <EscapeUtils.h>
#include <coemain.h>
#include <f32file.h>
#include "XmlHandler.h"
#include <aknnotewrappers.h>
#include <EscapeUtils.h>
// CONSTANTS
const TInt KBufferSize = 1024; // buffer size to store the result of
const TInt KFileBufferSize = 1024; // buffer size for file reading
const TInt KBufferSize = 1024; // buffer size to store the result of
const TInt KFileBufferSize = 1024; // buffer size for file reading
_LIT(KOpeningTag, "<" );
_LIT(KClosingTag, ">" );
_LIT(KSlash, "/" );
_LIT(KEndOfLine, "/f" );
// CEikEdwin uses '/f' as EOF mark.
_LIT8( KXmlMimeType, "text/xml" );
_LIT(KClosingTag, ">" );
_LIT(KSlash, "/" );
_LIT(KEndOfLine, "/f" );
// CEikEdwin uses '/f' as EOF mark.
_LIT8( KXmlMimeType, "text/xml" );
// METHODS DEFINITION
// --------------------------------------------------------------------------
_LIT8(KMname_zh,"Mname_zh");
_LIT8(KMname_en,"Mname_en");
_LIT8(KZip,"zip");
_LIT8(KPath,"path");
_LIT8(KJurnal,"jurnal");
_LIT8(KImage,"image");
_LIT8(KDescription,"description");
_LIT8(KMsize,"Msize");
_LIT8(KSysText,"systext");
_LIT8(KBigTypeName,"MbigTypeName");
_LIT8(KBigTypeId,"MbigId");
_LIT8(KSmallTypeName,"MsmallTpyeName");
_LIT8(KSmallTypeId,"MsmallId");
#include <UTF.H>
#define _MAGZINE_TYPE 5
CXmlHandler* CXmlHandler::NewL(MXmlHandlerObserver& aObserver)
{
CXmlHandler* self = CXmlHandler::NewLC(aObserver);
CleanupStack::Pop();
return self;
}
_LIT8(KMname_zh,"Mname_zh");
_LIT8(KMname_en,"Mname_en");
_LIT8(KZip,"zip");
_LIT8(KPath,"path");
_LIT8(KJurnal,"jurnal");
_LIT8(KImage,"image");
_LIT8(KDescription,"description");
_LIT8(KMsize,"Msize");
_LIT8(KSysText,"systext");
_LIT8(KBigTypeName,"MbigTypeName");
_LIT8(KBigTypeId,"MbigId");
_LIT8(KSmallTypeName,"MsmallTpyeName");
_LIT8(KSmallTypeId,"MsmallId");
#include <UTF.H>
#define _MAGZINE_TYPE 5
CXmlHandler* CXmlHandler::NewL(MXmlHandlerObserver& aObserver)
{
CXmlHandler* self = CXmlHandler::NewLC(aObserver);
CleanupStack::Pop();
return self;
}
// --------------------------------------------------------------------------
CXmlHandler* CXmlHandler::NewLC(MXmlHandlerObserver& aObserver)
{
CXmlHandler* self = new (ELeave) CXmlHandler(aObserver);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
{
CXmlHandler* self = new (ELeave) CXmlHandler(aObserver);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
// --------------------------------------------------------------------------
CXmlHandler::~CXmlHandler()
{
Cancel();
if(iParser)
{
delete iParser;
iParser = NULL;
}
if(iDisplayResult)
{
delete iDisplayResult;
iDisplayResult = NULL;
}
if(iBuffer)
{
delete iBuffer;
iBuffer=NULL;
}
if(iSysnewText)
{
delete iSysnewText;
iSysnewText=NULL;
}
if(iXMLData)
{
delete iXMLData;
iXMLData=NULL;
}
if(iXMLDataType)
{
delete iXMLDataType;
iXMLDataType=NULL;
}
iXMLDataArray.ResetAndDestroy();
iXMLDataTypeArray.ResetAndDestroy();
iFile.Close();
}
{
Cancel();
if(iParser)
{
delete iParser;
iParser = NULL;
}
if(iDisplayResult)
{
delete iDisplayResult;
iDisplayResult = NULL;
}
if(iBuffer)
{
delete iBuffer;
iBuffer=NULL;
}
if(iSysnewText)
{
delete iSysnewText;
iSysnewText=NULL;
}
if(iXMLData)
{
delete iXMLData;
iXMLData=NULL;
}
if(iXMLDataType)
{
delete iXMLDataType;
iXMLDataType=NULL;
}
iXMLDataArray.ResetAndDestroy();
iXMLDataTypeArray.ResetAndDestroy();
iFile.Close();
}
// --------------------------------------------------------------------------
CXmlHandler::CXmlHandler(MXmlHandlerObserver& aObserver) :
CActive(EPriorityStandard), iObserver(aObserver), iParser(0),
iDisplayResult(0), iState(EIdle)
{
CActiveScheduler::Add(this);
}
CActive(EPriorityStandard), iObserver(aObserver), iParser(0),
iDisplayResult(0), iState(EIdle)
{
CActiveScheduler::Add(this);
}
// --------------------------------------------------------------------------
void CXmlHandler::DoCancel()
{
iParser->ParseEndL();
iFile.Close();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
}
void CXmlHandler::Reset()
{
iXMLDataArray.ResetAndDestroy();
iXMLDataTypeArray.ResetAndDestroy();
}
// --------------------------------------------------------------------------
{
iParser->ParseEndL();
iFile.Close();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
}
void CXmlHandler::Reset()
{
iXMLDataArray.ResetAndDestroy();
iXMLDataTypeArray.ResetAndDestroy();
}
// --------------------------------------------------------------------------
void CXmlHandler::RunL()
{
if (KErrNone == iStatus.Int())
{
// If the buffe length is zero, it means if we have reached
// the end of the file.
if (iBuffer->Length() == 0)
{
iParser->ParseEndL();
iFile.Close();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iObserver.OnParseCompleted(iStatus.Int(), iXMLDataArray, iXMLDataTypeArray, iNum);
}
{
if (KErrNone == iStatus.Int())
{
// If the buffe length is zero, it means if we have reached
// the end of the file.
if (iBuffer->Length() == 0)
{
iParser->ParseEndL();
iFile.Close();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iObserver.OnParseCompleted(iStatus.Int(), iXMLDataArray, iXMLDataTypeArray, iNum);
}
// Otherwise, we continue reading the next chunk of the XML file.
else
{
// Parse the next "part" of the XML document.
iParser->ParseL(*iBuffer);
else
{
// Parse the next "part" of the XML document.
iParser->ParseL(*iBuffer);
// Read the next chunk of the file.
TPtr8 bufferPtr(iBuffer->Des());
iFile.Read(bufferPtr, KFileBufferSize, iStatus);
TPtr8 bufferPtr(iBuffer->Des());
iFile.Read(bufferPtr, KFileBufferSize, iStatus);
// Don't forget to call this... :)
SetActive();
}
}
else
{
//iObserver.OnParseCompleted(iStatus.Int());
}
}
SetActive();
}
}
else
{
//iObserver.OnParseCompleted(iStatus.Int());
}
}
// --------------------------------------------------------------------------
void CXmlHandler::ConstructL()
{
iParser = CParser::NewL(KXmlMimeType, *this);
iDisplayResult = HBufC::NewL(KBufferSize);
iXMLDataType = TXMLDataType::NewL();
iXMLData = XML_Data::NewL();
iFlag = EFalse;
{
iParser = CParser::NewL(KXmlMimeType, *this);
iDisplayResult = HBufC::NewL(KBufferSize);
iXMLDataType = TXMLDataType::NewL();
iXMLData = XML_Data::NewL();
iFlag = EFalse;
iSysnewText = HBufC::NewL(0);
}
}
// --------------------------------------------------------------------------
void CXmlHandler::StartParsingL(const TDesC& aFileName)
{
// Read the whole content of aFileName into iBuffer.
// IMPORTANT: This example reads the whole content within
// one-shot for simplicity reason.
// In reality, you have to read it chunk by chunk
// using active object so that your application doesn't block.
RFile file;
User::LeaveIfError(file.Open(CCoeEnv::Static()->FsSession(), aFileName,
EFileRead));
CleanupClosePushL(file);
{
// Read the whole content of aFileName into iBuffer.
// IMPORTANT: This example reads the whole content within
// one-shot for simplicity reason.
// In reality, you have to read it chunk by chunk
// using active object so that your application doesn't block.
RFile file;
User::LeaveIfError(file.Open(CCoeEnv::Static()->FsSession(), aFileName,
EFileRead));
CleanupClosePushL(file);
iDisplayResult->Des().Zero();
TInt size;
User::LeaveIfError(file.Size(size));
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iBuffer = HBufC8::NewL(size);
TPtr8 bufferPtr(iBuffer->Des());
User::LeaveIfError(file.Read(bufferPtr));
TInt size;
User::LeaveIfError(file.Size(size));
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iBuffer = HBufC8::NewL(size);
TPtr8 bufferPtr(iBuffer->Des());
User::LeaveIfError(file.Read(bufferPtr));
CleanupStack::PopAndDestroy(); // file
// Now, we have the whole file content in iBuffer.
// We are ready to parse the XML content.
iParser->ParseBeginL();
iParser->ParseL(*iBuffer);
// We are ready to parse the XML content.
iParser->ParseBeginL();
iParser->ParseL(*iBuffer);
// Since we read the whole file contents within one-shot,
// we can call ParseEndL() right after calling ParseL().
iParser->ParseEndL();
//iObserver.OnParseCompleted(0);
}
// we can call ParseEndL() right after calling ParseL().
iParser->ParseEndL();
//iObserver.OnParseCompleted(0);
}
// --------------------------------------------------------------------------
void CXmlHandler::StartParsingWithAoL(const TDesC& aFileName, TInt aNum)
{
// Remember to cancel any outstanding request first.
if (IsActive())
{
Cancel();
}
iNum = aNum;
User::LeaveIfError(iFile.Open(CCoeEnv::Static()->FsSession(), aFileName,
EFileRead));
{
// Remember to cancel any outstanding request first.
if (IsActive())
{
Cancel();
}
iNum = aNum;
User::LeaveIfError(iFile.Open(CCoeEnv::Static()->FsSession(), aFileName,
EFileRead));
// Create a buffer to store the file content.
// Note that this method uses active object to read the file.
// So we have to call SetActive() at the end. Then we call CParser::ParseL()
// in RunL() method.
iDisplayResult->Des().Zero();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iBuffer = HBufC8::NewL(KFileBufferSize);
TPtr8 bufferPtr(iBuffer->Des());
iFile.Read(bufferPtr, KFileBufferSize, iStatus);
SetActive();
// Note that this method uses active object to read the file.
// So we have to call SetActive() at the end. Then we call CParser::ParseL()
// in RunL() method.
iDisplayResult->Des().Zero();
if(iBuffer)
{
delete iBuffer;
iBuffer = 0;
}
iBuffer = HBufC8::NewL(KFileBufferSize);
TPtr8 bufferPtr(iBuffer->Des());
iFile.Read(bufferPtr, KFileBufferSize, iStatus);
SetActive();
// Tell the parser that we are about to parse a XML document.
iParser->ParseBeginL();
}
iParser->ParseBeginL();
}
// --------------------------------------------------------------------------
void CXmlHandler::OnStartDocumentL(const RDocumentParameters& /*aDocParam*/,
TInt aErrorCode)
{
TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
{
}
else
{
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnEndDocumentL(TInt aErrorCode)
{
// Display message to the screen stating that this is the starting of
// XML document.
_LIT( KOnEndDocumentL, "*** OnEndDocumentL ***/f" );
{
// Display message to the screen stating that this is the starting of
// XML document.
_LIT( KOnEndDocumentL, "*** OnEndDocumentL ***/f" );
if (KErrNone == aErrorCode)
{
}
}
{
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnStartElementL(const RTagInfo& aElement,
const RAttributeArray& aAttributes, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
iFlag = ETrue;
iBuf.Copy(aElement.LocalName().DesC());
}
else
{
//iObserver.OnParseCompleted(aErrorCode);
}
}
// --------------------------------------------------------------------------
const RAttributeArray& aAttributes, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
iFlag = ETrue;
iBuf.Copy(aElement.LocalName().DesC());
}
else
{
//iObserver.OnParseCompleted(aErrorCode);
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnEndElementL(const RTagInfo &aElement, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
}
else
{
}
}
{
if (KErrNone == aErrorCode)
{
}
else
{
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnContentL(const TDesC8 &aBytes, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
void CXmlHandler::OnContentL(const TDesC8 &aBytes, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
if(!iFlag)
{
return ;
}
if(0 == aBytes.Length())
{
return;
}
if(0 == aBytes.Compare(_L8("/n")))
{
return;
}
{
return ;
}
if(0 == aBytes.Length())
{
return;
}
if(0 == aBytes.Compare(_L8("/n")))
{
return;
}
if (0 == aBytes.Compare(_L8("/t")))
{
return ;
}
if (0 == aBytes.Compare(_L8("/t/t")))
{
return ;
}
iLength = aBytes.Length() + 1;
HBufC8 *buf8 = NULL;
buf8 = HBufC8::NewL(iLength);
TPtr8 ptr8(buf8->Des());
ptr8.Copy(aBytes);
HBufC *buf = NULL;
buf = HBufC::NewL(iLength);
TPtr ptr = buf->Des();
TRAPD(err,CnvUtfConverter::ConvertToUnicodeFromUtf8(ptr, ptr8));
delete buf8;
if (0 == iBuf.Compare(KMname_zh))
{
iXMLData->SetMname_zh(buf->Des());
}
else if (0 == iBuf.Compare(KMname_en))
{
iXMLData->SetMname_en(buf->Des());
}
else if (0 == iBuf.Compare(KZip))
{
iXMLData->SetZip(buf->Des());
}
else if (0 == iBuf.Compare(KPath))
{
iXMLData->SetPath(buf->Des());
}
else if (0 == iBuf.Compare(KJurnal))
{
iXMLData->SetJurnal(buf->Des());
}
else if (0 == iBuf.Compare(KImage))
{
iXMLData->SetImage(buf->Des());
}
else if (0 == iBuf.Compare(KDescription))
{
iXMLData->SetDescription(buf->Des());
}
else if (0 == iBuf.Compare(KMsize))
{
iXMLData->SetMsize(buf->Des());
iXMLDataArray.Append(iXMLData);
iXMLData = NULL;
iXMLData = XML_Data::NewL();
}
{
return ;
}
if (0 == aBytes.Compare(_L8("/t/t")))
{
return ;
}
iLength = aBytes.Length() + 1;
HBufC8 *buf8 = NULL;
buf8 = HBufC8::NewL(iLength);
TPtr8 ptr8(buf8->Des());
ptr8.Copy(aBytes);
HBufC *buf = NULL;
buf = HBufC::NewL(iLength);
TPtr ptr = buf->Des();
TRAPD(err,CnvUtfConverter::ConvertToUnicodeFromUtf8(ptr, ptr8));
delete buf8;
if (0 == iBuf.Compare(KMname_zh))
{
iXMLData->SetMname_zh(buf->Des());
}
else if (0 == iBuf.Compare(KMname_en))
{
iXMLData->SetMname_en(buf->Des());
}
else if (0 == iBuf.Compare(KZip))
{
iXMLData->SetZip(buf->Des());
}
else if (0 == iBuf.Compare(KPath))
{
iXMLData->SetPath(buf->Des());
}
else if (0 == iBuf.Compare(KJurnal))
{
iXMLData->SetJurnal(buf->Des());
}
else if (0 == iBuf.Compare(KImage))
{
iXMLData->SetImage(buf->Des());
}
else if (0 == iBuf.Compare(KDescription))
{
iXMLData->SetDescription(buf->Des());
}
else if (0 == iBuf.Compare(KMsize))
{
iXMLData->SetMsize(buf->Des());
iXMLDataArray.Append(iXMLData);
iXMLData = NULL;
iXMLData = XML_Data::NewL();
}
else if(0 == iBuf.Compare(KSysText))
{
if(iSysnewText != NULL)
{
delete iSysnewText;
iSysnewText = NULL;
}
iSysnewText = HBufC::NewL(buf->Length());
iSysnewText->Des().Copy(buf->Des());
}
{
if(iSysnewText != NULL)
{
delete iSysnewText;
iSysnewText = NULL;
}
iSysnewText = HBufC::NewL(buf->Length());
iSysnewText->Des().Copy(buf->Des());
}
else if(0 == iBuf.Compare(KBigTypeName) || 0 == iBuf.Compare(KSmallTypeName))
{
iXMLDataType->SetTypeName(buf->Des());
}
else if(0 == iBuf.Compare(KBigTypeId) || 0 == iBuf.Compare(KSmallTypeId) )
{
iXMLDataType->SetTypeID(buf->Des());
iXMLDataTypeArray.Append(iXMLDataType);
iXMLDataType = NULL;
iXMLDataType = TXMLDataType::NewL();
}
delete buf;
}
else
{
{
iXMLDataType->SetTypeName(buf->Des());
}
else if(0 == iBuf.Compare(KBigTypeId) || 0 == iBuf.Compare(KSmallTypeId) )
{
iXMLDataType->SetTypeID(buf->Des());
iXMLDataTypeArray.Append(iXMLDataType);
iXMLDataType = NULL;
iXMLDataType = TXMLDataType::NewL();
}
delete buf;
}
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnStartPrefixMappingL(const RString& /*aPrefix*/,
const RString& /*aUri*/, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
// Do something here...
}
else
{
const RString& /*aUri*/, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
// Do something here...
}
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnEndPrefixMappingL(const RString& /*aPrefix*/,
TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
}
else
{
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/,
TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
}
else
{
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnSkippedEntityL(const RString& /*aName*/, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
// Do something here...
}
else
{
{
if (KErrNone == aErrorCode)
{
// Do something here...
}
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnProcessingInstructionL(const TDesC8& /*aTarget*/,
const TDesC8& /*aData*/, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
const TDesC8& /*aData*/, TInt aErrorCode)
{
if (KErrNone == aErrorCode)
{
}
else
{
else
{
}
}
}
// --------------------------------------------------------------------------
void CXmlHandler::OnError(TInt aErrorCode)
{
_LIT( KErrorMessage, "*** OnError ***/f" );
}
{
_LIT( KErrorMessage, "*** OnError ***/f" );
}
// --------------------------------------------------------------------------
TAny* CXmlHandler::GetExtendedInterface(const TInt32 /*aUid*/)
{
return 0;
}
{
return 0;
}
// End of File