equal
deleted
inserted
replaced
809 iStringPool.OpenStringL(KNullDesC8()), |
809 iStringPool.OpenStringL(KNullDesC8()), |
810 iStringPool.OpenStringL(KNullDesC8()), |
810 iStringPool.OpenStringL(KNullDesC8()), |
811 iStringPool.OpenStringL(KAttribute()), |
811 iStringPool.OpenStringL(KAttribute()), |
812 iStringPool.OpenStringL(KAttributeValue()))); |
812 iStringPool.OpenStringL(KAttributeValue()))); |
813 |
813 |
|
814 if (err != KErrNone) |
|
815 { |
|
816 iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err ); |
|
817 CleanupStack::PopAndDestroy(); |
|
818 return err; |
|
819 } |
|
820 |
814 // make a new array for all attributes including namespace (to be added) |
821 // make a new array for all attributes including namespace (to be added) |
815 RAttributeArray justAttributes; |
822 RAttributeArray justAttributes; |
816 |
823 |
817 // append the namespace attribute (declaration) |
824 // append the namespace attribute (declaration) |
818 justAttributes.Append(justAttribute); |
825 justAttributes.Append(justAttribute); |
835 iStringPool.OpenStringL(KNullDesC8()), |
842 iStringPool.OpenStringL(KNullDesC8()), |
836 iStringPool.OpenStringL(KNullDesC8()), |
843 iStringPool.OpenStringL(KNullDesC8()), |
837 iStringPool.OpenStringL(KAttribute()), |
844 iStringPool.OpenStringL(KAttribute()), |
838 iStringPool.OpenStringL(KAttributeValue()))); |
845 iStringPool.OpenStringL(KAttributeValue()))); |
839 |
846 |
|
847 if (err != KErrNone) |
|
848 { |
|
849 iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err ); |
|
850 CleanupStack::PopAndDestroy(); |
|
851 return err; |
|
852 } |
|
853 |
840 RAttributeArray justAttributes; |
854 RAttributeArray justAttributes; |
841 justAttributes.Append(justAttribute); |
855 justAttributes.Append(justAttribute); |
842 |
856 |
843 iFrg = CSenBaseFragment::NewL(_L8("BaseFrag")); |
857 iFrg = CSenBaseFragment::NewL(_L8("BaseFrag")); |
844 iFrg->SetReader( *iXmlReader ); |
858 iFrg->SetReader( *iXmlReader ); |
2103 xmlDoc.Append(arg); |
2117 xmlDoc.Append(arg); |
2104 } |
2118 } |
2105 |
2119 |
2106 HBufC8* pTestXml = HBufC8::NewLC( xmlDoc.Length() ); |
2120 HBufC8* pTestXml = HBufC8::NewLC( xmlDoc.Length() ); |
2107 pTestXml->Des().Append(xmlDoc); |
2121 pTestXml->Des().Append(xmlDoc); |
2108 CSenElement* newElement; |
2122 CSenElement* newElement = NULL; |
2109 |
2123 |
2110 //adding parsed document to SenElement and copy it to iElement |
2124 //adding parsed document to SenElement and copy it to iElement |
2111 |
2125 |
2112 TRAPD(rParse, newElement = ParseToElementL(pTestXml)); |
2126 TRAPD(rParse, newElement = ParseToElementL(pTestXml)); |
2113 if (rParse != KErrNone) { |
2127 if (rParse != KErrNone) { |
2253 TPtrC arg; |
2267 TPtrC arg; |
2254 aItem.GetNextString(arg); |
2268 aItem.GetNextString(arg); |
2255 TBuf8<128> name; |
2269 TBuf8<128> name; |
2256 name.Append(arg); |
2270 name.Append(arg); |
2257 |
2271 |
2258 RAttributeArray apAttrs; |
2272 /*RAttributeArray apAttrs; |
2259 |
2273 |
2260 HBufC8* newAttr; |
2274 HBufC8* newAttr; |
2261 |
2275 |
2262 /*TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) ); |
2276 TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) ); |
2263 if (r != KErrNone) { |
2277 if (r != KErrNone) { |
2264 iLog->Log(_L("AllocAttrValueL failed. Error: %d"), r ); |
2278 iLog->Log(_L("AllocAttrValueL failed. Error: %d"), r ); |
2265 return r; |
2279 return r; |
2266 }*/ |
2280 } |
2267 |
2281 |
2268 if ( newAttr!= NULL ){ |
2282 if ( newAttr!= NULL ){ |
2269 delete newAttr; |
2283 delete newAttr; |
2270 newAttr = NULL; |
2284 newAttr = NULL; |
2271 } |
2285 }*/ |
2272 |
2286 |
2273 iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********")); |
2287 iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********")); |
2274 return error; |
2288 return error; |
2275 } |
2289 } |
2276 |
2290 |
3003 iLog->Log(_L("Parsing failed. Error: %d"), rParse ); |
3017 iLog->Log(_L("Parsing failed. Error: %d"), rParse ); |
3004 CleanupStack::PopAndDestroy(2); |
3018 CleanupStack::PopAndDestroy(2); |
3005 return error; |
3019 return error; |
3006 } |
3020 } |
3007 //AsXML "UTF8" |
3021 //AsXML "UTF8" |
3008 HBufC8* pBuf; |
3022 HBufC8* pBuf = NULL; |
3009 |
3023 |
3010 TRAPD(rAsXml, pBuf = pDom->AsXmlL()); |
3024 TRAPD(rAsXml, pBuf = pDom->AsXmlL()); |
3011 if (rAsXml != KErrNone) |
3025 if (rAsXml != KErrNone) |
3012 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml ); |
3026 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml ); |
3013 |
3027 |
3015 |
3029 |
3016 iLog->Log( _L("Parsed message:") ); |
3030 iLog->Log( _L("Parsed message:") ); |
3017 iLog->Log(*pBuf); |
3031 iLog->Log(*pBuf); |
3018 LogResultL( *pBuf ); |
3032 LogResultL( *pBuf ); |
3019 //AsXMLUnicode |
3033 //AsXMLUnicode |
3020 HBufC16* pBuf2; |
3034 HBufC16* pBuf2 = NULL; |
3021 |
3035 |
3022 TRAPD(rAsXmlUnicode, pBuf2 = pDom->AsXmlUnicodeL()); |
3036 TRAPD(rAsXmlUnicode, pBuf2 = pDom->AsXmlUnicodeL()); |
3023 if (rAsXmlUnicode != KErrNone) |
3037 if (rAsXmlUnicode != KErrNone) |
3024 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXmlUnicode ); |
3038 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXmlUnicode ); |
3025 |
3039 |
3081 #endif |
3095 #endif |
3082 |
3096 |
3083 // close fsSession |
3097 // close fsSession |
3084 CleanupStack::PopAndDestroy(); |
3098 CleanupStack::PopAndDestroy(); |
3085 // Store parsed documed in file |
3099 // Store parsed documed in file |
3086 HBufC8* pBuf; |
3100 HBufC8* pBuf = NULL; |
3087 // Convert document |
3101 // Convert document |
3088 TRAPD(rAsXml, pBuf = pDom->AsXmlL()); |
3102 TRAPD(rAsXml, pBuf = pDom->AsXmlL()); |
3089 if (rAsXml != KErrNone) |
3103 if (rAsXml != KErrNone) |
3090 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml ); |
3104 iLog->Log(_L("Converting to text failed. Error: %d"), rAsXml ); |
3091 //Write information to log files |
3105 //Write information to log files |