/** This method is a callback to indicate the start of the document. @param aDocParam Specifies the various parameters of the document. aDocParam.iCharacterSetName The character encoding of the document. @param aErrorCode is the error code. If this is not KErrNone then special action may be required. */ void CTestHandler::OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode) { _LIT8(KOnStartDocumentFuncName,"OnStartDocument()\r\n"); _LIT8(KInfoOnStartDocP,"\tDocument start \tparameters: %S \r\n"); _LIT8(KInfoOnError,"Error occurs %d \r\n"); iLog.Write(KOnStartDocumentFuncName); if (aErrorCode == KErrNone) { TBuf8<KShortInfoSize> info; TBuf8<KShortInfoSize> info2; info2.Copy(aDocParam.CharacterSetName().DesC()); info.Format(KInfoOnStartDocP,&info2); iLog.Write(info); } else { TBuf8<KShortInfoSize> info; info.Format(KInfoOnError,aErrorCode); iLog.Write(info); } }
void TRebuildingContentHandler::OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode) { User::LeaveIfError(aErrorCode); iOutFile.Write(_L8("<?xml encoding=\"")); iOutFile.Write(aDocParam.CharacterSetName().DesC()); iOutFile.Write(_L8("\"")); iOutFile.Write(_L8("?>\n")); }