secureswitools/swisistools/source/xmlparser/xmlparser.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    25 */
    25 */
    26 
    26 
    27 #include "xmlparser.h"
    27 #include "xmlparser.h"
    28 #include "logs.h"
    28 #include "logs.h"
    29 #include "exception.h"
    29 #include "exception.h"
    30 #include "utf8_wrapper.h"
       
    31 #include "util.h"
    30 #include "util.h"
    32 #include "utility.h"
       
    33 
    31 
    34 #include <xercesc/sax2/XMLReaderFactory.hpp>
    32 #include <xercesc/sax2/XMLReaderFactory.hpp>
    35 #include <xercesc/sax2/DefaultHandler.hpp>
    33 #include <xercesc/sax2/DefaultHandler.hpp>
    36 #include <xercesc/util/XMLString.hpp>
    34 #include <xercesc/util/XMLString.hpp>
    37 #include <xercesc/util/PlatformUtils.hpp>
    35 #include <xercesc/util/PlatformUtils.hpp>
    42 #include <vector>
    40 #include <vector>
    43 
    41 
    44 #include <memory>
    42 #include <memory>
    45 #include <cstdio>
    43 #include <cstdio>
    46 
    44 
    47 #ifndef _WIN32
       
    48 #include <ctype.h>
       
    49 
       
    50 //__ctype_b was removed from glibc. This is a workaround to fix the linking problem
       
    51 extern "C"
       
    52     {
       
    53     const unsigned short int** __ctype_b()
       
    54         {
       
    55         return __ctype_b_loc();
       
    56         }
       
    57     }
       
    58 
       
    59 #endif // _WIN32
       
    60 
       
    61 XERCES_CPP_NAMESPACE_USE
    45 XERCES_CPP_NAMESPACE_USE
    62 
       
    63 
       
    64 //------------------------------------------------------------------------------------------------------------------------------
       
    65 //											UTILITY FUNCTIONS
       
    66 //------------------------------------------------------------------------------------------------------------------------------
       
    67 int XercesStringToInteger(const XercesString& aWideStr)
       
    68 	{
       
    69 	int strLen = aWideStr.length();
       
    70 	const XMLCh* source = aWideStr.c_str();	
       
    71   char* buffer = new char[strLen << 2];
       
    72   
       
    73 	// Using a temp variable in place of buffer as ConvertUTF16toUTF8 modifies the source pointer passed.
       
    74 	char* temp = buffer;	
       
    75 	
       
    76 	ConvertUTF16toUTF8(&source, aWideStr.c_str() + strLen, &temp,  temp + (strLen << 2));
       
    77 	
       
    78 	// Appending NUL to the converted buffer.
       
    79 	*temp = 0;
       
    80 
       
    81 	int value = 0;
       
    82 	sscanf(buffer, "%d", &value);
       
    83 
       
    84 	delete[] buffer;
       
    85 	return value;
       
    86 	}
       
    87 
       
    88 
    46 
    89 // these function pointers are used to call appropriate release methods of XMLString
    47 // these function pointers are used to call appropriate release methods of XMLString
    90 // present in the xerces library. 
    48 // present in the xerces library. 
    91 typedef void (*releaseXmlChPtr) (XMLCh** buf);
    49 typedef void (*releaseXmlChPtr) (XMLCh** buf);
    92 typedef void (*releaseChPtr) (char** buf);
    50 typedef void (*releaseChPtr) (char** buf);
    93 
    51 
    94 #ifdef _WIN32
       
    95 
       
    96 // We need not do anything for WINDOWS, since XMLCh string(XercesString)
       
    97 // and WString both are same and will be in UTF-16 encoding format.
       
    98 #define XMLChToWString(aParameter) (aParameter)
       
    99 
       
   100 #else
       
   101 inline std::wstring XMLChToWString(const XercesString& aXercesString)
       
   102 	{
       
   103 	return XercesStringToWString (aXercesString);
       
   104 	}
       
   105 #endif // _WIN32
       
   106 
    52 
   107 
    53 
   108 DllExport CScrXmlParser::CScrXmlParser()
    54 DllExport CScrXmlParser::CScrXmlParser()
   109 	{}
    55 	{}
   110 
    56 
   300 	
   246 	
   301 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeNames( &XMLString::release, XMLString::transcode("SoftwareTypeNames") );
   247 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeNames( &XMLString::release, XMLString::transcode("SoftwareTypeNames") );
   302 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagUniqueSoftwareTypeName( &XMLString::release, XMLString::transcode("UniqueSoftwareTypeName") );
   248 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagUniqueSoftwareTypeName( &XMLString::release, XMLString::transcode("UniqueSoftwareTypeName") );
   303 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocalizableSwTypeName( &XMLString::release, XMLString::transcode("LocalizableSoftwareTypeName") );
   249 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocalizableSwTypeName( &XMLString::release, XMLString::transcode("LocalizableSoftwareTypeName") );
   304 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSifPluginUid( &XMLString::release, XMLString::transcode("SifPluginUid") );
   250 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSifPluginUid( &XMLString::release, XMLString::transcode("SifPluginUid") );
   305 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLauncherExecutable( &XMLString::release, XMLString::transcode("LauncherExecutable") );
   251 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagInstallerSid( &XMLString::release, XMLString::transcode("InstallerSid") );
   306 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagCustomAcess( &XMLString::release, XMLString::transcode("CustomAcess") );
   252 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagExecutionLayerSid( &XMLString::release, XMLString::transcode("ExecutionLayerSid") );
   307 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEDetails( &XMLString::release, XMLString::transcode("MIMEDetails") );
   253 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEDetails( &XMLString::release, XMLString::transcode("MIMEDetails") );
   308 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEType( &XMLString::release, XMLString::transcode("MIMEType") );
   254 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEType( &XMLString::release, XMLString::transcode("MIMEType") );
   309 	
   255 	
   310 	DOMNodeList* swTypeNames = aEnvironment->getElementsByTagName(tagSoftwareTypeNames.get());
   256 	DOMNodeList* swTypeNames = aEnvironment->getElementsByTagName(tagSoftwareTypeNames.get());
   311 	DOMNode* swTypeNamesRoot	= swTypeNames->item(0);
   257 	DOMNode* swTypeNamesRoot	= swTypeNames->item(0);
   312 	DOMElement* swTypeNamesNode = static_cast< xercesc::DOMElement* >( swTypeNamesRoot );
   258 	DOMElement* swTypeNamesNode = static_cast< xercesc::DOMElement* >( swTypeNamesRoot );
   313 	
   259 	
   314 	DOMNodeList* uniqueSwTypeName = swTypeNamesNode->getElementsByTagName(tagUniqueSoftwareTypeName.get());
   260 	DOMNodeList* uniqueSwTypeName = swTypeNamesNode->getElementsByTagName(tagUniqueSoftwareTypeName.get());
   315 	const XMLCh* textContent = uniqueSwTypeName->item(0)->getTextContent();
   261 	const XMLCh* textContent = uniqueSwTypeName->item(0)->getTextContent();
   316 	scrEnvDetails.iUniqueSoftwareTypeName = XMLChToWString(textContent);
   262 	scrEnvDetails.iUniqueSoftwareTypeName = std::wstring(textContent);
   317 	
   263 	
   318 	DOMNodeList* localizableSwTypeNames = swTypeNamesNode->getElementsByTagName(tagLocalizableSwTypeName.get());
   264 	DOMNodeList* localizableSwTypeNames = swTypeNamesNode->getElementsByTagName(tagLocalizableSwTypeName.get());
   319 	const  XMLSize_t localizableSwTypeNamesCount = localizableSwTypeNames->getLength();
   265 	const  XMLSize_t localizableSwTypeNamesCount = localizableSwTypeNames->getLength();
   320 	for( XMLSize_t count=0 ; count<localizableSwTypeNamesCount ; ++count )
   266 	for( XMLSize_t count=0 ; count<localizableSwTypeNamesCount ; ++count )
   321 		{
   267 		{
   330 	fn_auto_ptr<releaseChPtr,char> sifPluginUidText(&XMLString::release, XMLString::transcode(textContent));
   276 	fn_auto_ptr<releaseChPtr,char> sifPluginUidText(&XMLString::release, XMLString::transcode(textContent));
   331 	int sifPluginUidValue = 0;
   277 	int sifPluginUidValue = 0;
   332 	sscanf(sifPluginUidText.get(),"%x",&sifPluginUidValue);
   278 	sscanf(sifPluginUidText.get(),"%x",&sifPluginUidValue);
   333 	scrEnvDetails.iSifPluginUid = sifPluginUidValue;
   279 	scrEnvDetails.iSifPluginUid = sifPluginUidValue;
   334 	
   280 	
   335     DOMNodeList* launcherExecutable = aEnvironment->getElementsByTagName(tagLauncherExecutable.get());
   281 	DOMNodeList* installerSid = aEnvironment->getElementsByTagName(tagInstallerSid.get());
   336     if(0 != launcherExecutable->getLength())
   282 	textContent = installerSid->item(0)->getTextContent();
   337         {
   283 	fn_auto_ptr<releaseChPtr,char> installerSidText(&XMLString::release, XMLString::transcode(textContent));
   338 		textContent = launcherExecutable->item(0)->getTextContent();
   284 	int installerSidValue = 0;
   339 		fn_auto_ptr<releaseXmlChPtr, XMLCh> launcherExecutableText( &XMLString::release,textContent );
   285 	sscanf(installerSidText.get(),"%x",&installerSidValue);
   340 		const XMLCh* launcherExecutableValue = launcherExecutableText.get();
   286 	scrEnvDetails.iInstallerSid = installerSidValue;
   341 		scrEnvDetails.iLauncherExecutable = XMLChToWString(launcherExecutableValue);
   287 	
   342 		}
   288 	DOMNodeList* executionLayerSid = aEnvironment->getElementsByTagName(tagExecutionLayerSid.get());
   343     DOMNodeList* customAcessList = aEnvironment->getElementsByTagName(tagCustomAcess.get());
   289 	textContent = executionLayerSid->item(0)->getTextContent();
   344 	const  XMLSize_t customAcessDataCount = customAcessList->getLength();
   290 	fn_auto_ptr<releaseChPtr,char> executionLayerSidText(&XMLString::release, XMLString::transcode(textContent));
   345 	for( XMLSize_t count=0 ; count<customAcessDataCount ; ++count )
   291 	int executionLayerSidValue = 0;
   346 		{
   292 	sscanf(executionLayerSidText.get(),"%x",&executionLayerSidValue);
   347 		DOMNode* customAcessRoot = customAcessList->item(count);
   293 	scrEnvDetails.iExecutionLayerSid = executionLayerSidValue;
   348 		DOMElement* customAcessNode = static_cast< xercesc::DOMElement* >( customAcessRoot );
       
   349 		XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessData = GetCustomAcessList(customAcessNode);
       
   350 		scrEnvDetails.iCustomAcessList.push_back(customAcessData);
       
   351 		}
       
   352 	
   294 	
   353 	DOMNodeList* mimeDetails = aEnvironment->getElementsByTagName(tagMIMEDetails.get());
   295 	DOMNodeList* mimeDetails = aEnvironment->getElementsByTagName(tagMIMEDetails.get());
   354 	DOMNode* mimeDetailRoot	= mimeDetails->item(0);
   296 	DOMNode* mimeDetailRoot	= mimeDetails->item(0);
   355 	DOMElement* mimeDetailNode = static_cast< xercesc::DOMElement* >( mimeDetailRoot );
   297 	DOMElement* mimeDetailNode = static_cast< xercesc::DOMElement* >( mimeDetailRoot );
   356 	DOMNodeList* mimes = mimeDetailNode->getElementsByTagName(tagMIMEType.get());
   298 	DOMNodeList* mimes = mimeDetailNode->getElementsByTagName(tagMIMEType.get());
   357 	const  XMLSize_t mimeCount = mimes->getLength();
   299 	const  XMLSize_t mimeCount = mimes->getLength();
   358 	for( XMLSize_t count=0 ; count<mimeCount ; ++count )
   300 	for( XMLSize_t count=0 ; count<mimeCount ; ++count )
   359 		{
   301 		{
   360 		const XMLCh* textContent = mimes->item(count)->getTextContent();
   302 		const XMLCh* textContent = mimes->item(count)->getTextContent();
   361 		std::wstring textString = XMLChToWString(textContent);
   303 		scrEnvDetails.iMIMEDetails.push_back(textContent);
   362 		scrEnvDetails.iMIMEDetails.push_back(textString);
       
   363 		}
   304 		}
   364 			
   305 			
   365 	LOGEXIT("CScrXmlParser::GetEnvironmentData()");
   306 	LOGEXIT("CScrXmlParser::GetEnvironmentData()");
   366 	
   307 	
   367 	return scrEnvDetails;
   308 	return scrEnvDetails;
   402 		
   343 		
   403 		fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeName( &XMLString::release, XMLString::transcode("SoftwareTypeName") );
   344 		fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeName( &XMLString::release, XMLString::transcode("SoftwareTypeName") );
   404 	
   345 	
   405 		DOMNodeList* softwaretype = elementRoot->getElementsByTagName(tagSoftwareTypeName.get());
   346 		DOMNodeList* softwaretype = elementRoot->getElementsByTagName(tagSoftwareTypeName.get());
   406 		const XMLCh* textContent = softwaretype->item(0)->getTextContent();
   347 		const XMLCh* textContent = softwaretype->item(0)->getTextContent();
   407 		preProvisionDetail.iSoftwareTypeName = XMLChToWString(textContent);
   348 		preProvisionDetail.iSoftwareTypeName = std::wstring(textContent);
   408 	
   349 	
   409 		// Retrieve the nodes for Component.
   350 		// Retrieve the nodes for Component.
   410 		DOMNodeList* componentNodes = elementRoot->getElementsByTagName(tagComponent.get());
   351 		DOMNodeList* componentNodes = elementRoot->getElementsByTagName(tagComponent.get());
   411 		const  XMLSize_t nodeCount = componentNodes->getLength();
   352 		const  XMLSize_t nodeCount = componentNodes->getLength();
   412 		
   353 		
   438 	return preProvisionDetail;
   379 	return preProvisionDetail;
   439 	}
   380 	}
   440 
   381 
   441 XmlDetails::TScrPreProvisionDetail::TComponent CScrXmlParser::GetPreProvisionData( const DOMElement* aDOMElement)
   382 XmlDetails::TScrPreProvisionDetail::TComponent CScrXmlParser::GetPreProvisionData( const DOMElement* aDOMElement)
   442 	{
   383 	{
   443 	LOGENTER("CScrXmlParser::GetPreProvisionData()");
       
   444 	XmlDetails::TScrPreProvisionDetail::TComponent component;
   384 	XmlDetails::TScrPreProvisionDetail::TComponent component;
   445 	
   385 	
   446 	DOMNodeList* childNodes = aDOMElement->getChildNodes();
   386 	DOMNodeList* childNodes = aDOMElement->getChildNodes();
   447 	const XMLSize_t nodeCount = childNodes->getLength();
   387 	const XMLSize_t nodeCount = childNodes->getLength();
   448 	
   388 	
   450 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizable( &XMLString::release, XMLString::transcode("ComponentLocalizable") );
   390 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizable( &XMLString::release, XMLString::transcode("ComponentLocalizable") );
   451 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentProperty( &XMLString::release, XMLString::transcode("ComponentProperty") );
   391 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentProperty( &XMLString::release, XMLString::transcode("ComponentProperty") );
   452 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentFile( &XMLString::release, XMLString::transcode("ComponentFile") );
   392 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentFile( &XMLString::release, XMLString::transcode("ComponentFile") );
   453 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDetails( &XMLString::release, XMLString::transcode("ComponentDetails") );
   393 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDetails( &XMLString::release, XMLString::transcode("ComponentDetails") );
   454 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDependency( &XMLString::release, XMLString::transcode("ComponentDependency") );
   394 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDependency( &XMLString::release, XMLString::transcode("ComponentDependency") );
   455 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfo( &XMLString::release, XMLString::transcode("ApplicationRegistrationInfo") );
       
   456 
   395 
   457 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails = GetComponentDetails(aDOMElement);
   396 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails = GetComponentDetails(aDOMElement);
   458 	component.iComponentDetails = componentDetails;
   397 	component.iComponentDetails = componentDetails;
   459 
   398 
   460 	// for each ComponentProperty retrieve all tags
   399 	// for each ComponentProperty retrieve all tags
   481 		else if( XMLString::equals(currentElement->getTagName(), tagComponentDependency.get()))
   420 		else if( XMLString::equals(currentElement->getTagName(), tagComponentDependency.get()))
   482 			{
   421 			{
   483 			XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency = GetComponentDependency(currentElement);
   422 			XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency = GetComponentDependency(currentElement);
   484 			component.iComponentDependency = componentDependency;
   423 			component.iComponentDependency = componentDependency;
   485 			}
   424 			}
   486 		else if( XMLString::equals(currentElement->getTagName(), tagApplicationRegistrationInfo.get()))
   425 		}
   487 			{
   426 
   488 			XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo = GetApplicationRegistrationInfo(currentElement);
       
   489 			component.iApplicationRegistrationInfo.push_back(appRegistrationInfo);
       
   490 			}
       
   491 		}
       
   492 	LOGEXIT("CScrXmlParser::GetPreProvisionData()");
       
   493 	return component;
   427 	return component;
   494 	}
   428 	}
   495 
   429 
   496 XmlDetails::TScrPreProvisionDetail::TComponentLocalizable CScrXmlParser::GetComponentLocalizable(const DOMElement* aDOMElement)
   430 XmlDetails::TScrPreProvisionDetail::TComponentLocalizable CScrXmlParser::GetComponentLocalizable(const DOMElement* aDOMElement)
   497 	{
   431 	{
   498 	LOGENTER("CScrXmlParser::GetComponentLocalizable()");
       
   499 	// tags in ComponentLocalizable
   432 	// tags in ComponentLocalizable
   500 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableLocale( &XMLString::release, XMLString::transcode("ComponentLocalizable_Locale") );
   433 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableLocale( &XMLString::release, XMLString::transcode("ComponentLocalizable_Locale") );
   501 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableName( &XMLString::release, XMLString::transcode("ComponentLocalizable_Name") );
   434 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableName( &XMLString::release, XMLString::transcode("ComponentLocalizable_Name") );
   502 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableVendor( &XMLString::release, XMLString::transcode("ComponentLocalizable_Vendor") );
   435 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableVendor( &XMLString::release, XMLString::transcode("ComponentLocalizable_Vendor") );
   503 	
   436 	
   508 	XmlDetails::TScrPreProvisionDetail::TComponentLocalizable componentLocalizable;
   441 	XmlDetails::TScrPreProvisionDetail::TComponentLocalizable componentLocalizable;
   509 
   442 
   510 	if(locale->getLength() != 0)
   443 	if(locale->getLength() != 0)
   511 		{
   444 		{
   512 		const XMLCh* textLocale = locale->item(0)->getTextContent();
   445 		const XMLCh* textLocale = locale->item(0)->getTextContent();
   513 		componentLocalizable.iLocale = XercesStringToInteger(textLocale);
   446 		componentLocalizable.iLocale = Util::WideCharToInteger(textLocale);
   514 		}
   447 		}
   515 	
   448 	
   516 	const XMLCh* textName = name->item(0)->getTextContent();
   449 	const XMLCh* textName = name->item(0)->getTextContent();
   517 	componentLocalizable.iName = XMLChToWString(textName);
   450 	componentLocalizable.iName = textName;
   518 
   451 
   519 	if(vendor->getLength() != 0)
   452 	if(vendor->getLength() != 0)
   520 		{
   453 		{
   521 		const XMLCh* textVendor = vendor->item(0)->getTextContent();
   454 		const XMLCh* textVendor = vendor->item(0)->getTextContent();
   522 		componentLocalizable.iVendor = XMLChToWString(textVendor);
   455 		componentLocalizable.iVendor = textVendor;
   523 		}
   456 		}
   524 	LOGEXIT("CScrXmlParser::GetComponentLocalizable()");
   457 
   525 	return componentLocalizable;
   458 	return componentLocalizable;
   526 	
   459 	
   527 	}
   460 	}
   528 
   461 
   529 XmlDetails::TScrPreProvisionDetail::TComponentProperty CScrXmlParser::GetComponentProperty(const DOMElement* aEnvironment)
   462 XmlDetails::TScrPreProvisionDetail::TComponentProperty CScrXmlParser::GetComponentProperty(const DOMElement* aEnvironment)
   530 	{
   463 	{
   531 	LOGENTER("CScrXmlParser::GetComponentProperty()");
       
   532 	// tags in ComponentProperty
   464 	// tags in ComponentProperty
   533 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyName( &XMLString::release, XMLString::transcode("Name") );
   465 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyName( &XMLString::release, XMLString::transcode("Name") );
   534 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyLocale( &XMLString::release, XMLString::transcode("ComponentProperty_Locale") );
   466 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyLocale( &XMLString::release, XMLString::transcode("ComponentProperty_Locale") );
   535 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyValue( &XMLString::release, XMLString::transcode("ComponentProperty_Value") );
   467 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyValue( &XMLString::release, XMLString::transcode("ComponentProperty_Value") );
   536 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyIsBinary( &XMLString::release, XMLString::transcode("ComponentProperty_IsBinary") );
   468 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyIsBinary( &XMLString::release, XMLString::transcode("ComponentProperty_IsBinary") );
   548 	DOMNodeList* isBinary = aEnvironment->getElementsByTagName(tagComponentPropertyIsBinary.get());
   480 	DOMNodeList* isBinary = aEnvironment->getElementsByTagName(tagComponentPropertyIsBinary.get());
   549 	
   481 	
   550 	XmlDetails::TScrPreProvisionDetail::TComponentProperty componentProperty;
   482 	XmlDetails::TScrPreProvisionDetail::TComponentProperty componentProperty;
   551 	
   483 	
   552 	const XMLCh* textName = name->getTextContent();
   484 	const XMLCh* textName = name->getTextContent();
   553 	componentProperty.iName	= XMLChToWString(textName);
   485 	componentProperty.iName	= textName;
   554 	
   486 	
   555 	if(locale->getLength() != 0)
   487 	if(locale->getLength() != 0)
   556 		{
   488 		{
   557 		const XMLCh* textLocale = locale->item(0)->getTextContent();
   489 		const XMLCh* textLocale = locale->item(0)->getTextContent();
   558 		componentProperty.iLocale = XercesStringToInteger(textLocale);
   490 		componentProperty.iLocale = Util::WideCharToInteger(textLocale);
   559 		}
   491 		}
   560 
   492 
   561 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
   493 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
   562 	const XMLSize_t nodeCount = childNodes->getLength();
   494 	const XMLSize_t nodeCount = childNodes->getLength();
   563 
   495 
   565 		{
   497 		{
   566 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
   498 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
   567 		if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyIntValue.get()))
   499 		if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyIntValue.get()))
   568 			{
   500 			{
   569 			componentProperty.iIsIntValue = true;
   501 			componentProperty.iIsIntValue = true;
   570 			componentProperty.iValue = XMLChToWString(currentElement->getTextContent());
   502 			componentProperty.iValue = currentElement->getTextContent();
   571 			break;
   503 			break;
   572 			}
   504 			}
   573 		else if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyStrValue.get()))
   505 		else if( XMLString::equals(currentElement->getTagName(), tagComponentPropertyStrValue.get()))
   574 			{
   506 			{
   575 			componentProperty.iIsIntValue = false;
   507 			componentProperty.iIsIntValue = false;
   576 			componentProperty.iValue = XMLChToWString(currentElement->getTextContent());
   508 			componentProperty.iValue = currentElement->getTextContent();
   577 			break;
   509 			break;
   578 			}
   510 			}
   579 		}
   511 		}
   580 		
   512 		
   581 	if(isBinary->getLength() != 0)
   513 	if(isBinary->getLength() != 0)
   582 		{
   514 		{
   583 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
   515 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
   584 		componentProperty.iIsStr8Bit = XercesStringToInteger(textIsBinary);		
   516 		componentProperty.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
   585 		}
   517 		}
   586 	LOGEXIT("CScrXmlParser::GetComponentProperty()");
   518 
   587 	return componentProperty;
   519 	return componentProperty;
   588 	
   520 	
   589 	}
   521 	}
   590 
   522 
   591 XmlDetails::TScrPreProvisionDetail::TComponentFile CScrXmlParser::GetComponentFile( const DOMElement* aDOMElement)
   523 XmlDetails::TScrPreProvisionDetail::TComponentFile CScrXmlParser::GetComponentFile( const DOMElement* aDOMElement)
   592 	{
   524 	{
   593 	LOGENTER("CScrXmlParser::GetComponentFile()");
       
   594 	XmlDetails::TScrPreProvisionDetail::TComponentFile componentFile;
   525 	XmlDetails::TScrPreProvisionDetail::TComponentFile componentFile;
   595 	
   526 	
   596 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileProperty( &XMLString::release, XMLString::transcode("FileProperty") );
   527 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileProperty( &XMLString::release, XMLString::transcode("FileProperty") );
   597 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocation( &XMLString::release, XMLString::transcode("Location") );	
   528 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocation( &XMLString::release, XMLString::transcode("Location") );	
   598 	
   529 	
   609 		}
   540 		}
   610 	
   541 	
   611 	// attribute - location
   542 	// attribute - location
   612 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   543 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   613 	DOMNode* location = attributes->getNamedItem(tagLocation.get());
   544 	DOMNode* location = attributes->getNamedItem(tagLocation.get());
   614 	componentFile.iLocation = XMLChToWString(location->getTextContent());
   545 	componentFile.iLocation = location->getTextContent();
   615 	LOGEXIT("CScrXmlParser::GetComponentFile()");
   546 	
   616 	return componentFile;
   547 	return componentFile;
   617 	}
   548 	}
   618 
   549 
   619 XmlDetails::TScrPreProvisionDetail::TComponentDependency CScrXmlParser::GetComponentDependency( const XERCES_CPP_NAMESPACE::DOMElement* aDOMElement)
   550 XmlDetails::TScrPreProvisionDetail::TComponentDependency CScrXmlParser::GetComponentDependency( const XERCES_CPP_NAMESPACE::DOMElement* aDOMElement)
   620 	{
   551 	{
   621 	LOGENTER("CScrXmlParser::GetComponentDependency()");
       
   622 	XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency;
   552 	XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency;
   623 	
   553 	
   624 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDepList( &XMLString::release, XMLString::transcode("DependencyList") );
   554 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDepList( &XMLString::release, XMLString::transcode("DependencyList") );
   625 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDependentId( &XMLString::release, XMLString::transcode("DependentId") );	
   555 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDependentId( &XMLString::release, XMLString::transcode("DependentId") );	
   626 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSupplierId( &XMLString::release, XMLString::transcode("SupplierId") );	
   556 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSupplierId( &XMLString::release, XMLString::transcode("SupplierId") );	
   636 		XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail componentDependencyDetail;
   566 		XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail componentDependencyDetail;
   637 		DOMElement* currentDepDetail = static_cast< xercesc::DOMElement* >( depList->item(index) );
   567 		DOMElement* currentDepDetail = static_cast< xercesc::DOMElement* >( depList->item(index) );
   638 		
   568 		
   639 		DOMNodeList* supplierId = currentDepDetail->getElementsByTagName(tagSupplierId.get());
   569 		DOMNodeList* supplierId = currentDepDetail->getElementsByTagName(tagSupplierId.get());
   640 		const XMLCh* textSupplierId = supplierId->item(0)->getTextContent();
   570 		const XMLCh* textSupplierId = supplierId->item(0)->getTextContent();
   641 		componentDependencyDetail.iSupplierId = XMLChToWString(textSupplierId);
   571 		componentDependencyDetail.iSupplierId = std::wstring(textSupplierId);
   642 		
   572 		
   643 		DOMNodeList* fromVersion = currentDepDetail->getElementsByTagName(tagFromVersion.get());
   573 		DOMNodeList* fromVersion = currentDepDetail->getElementsByTagName(tagFromVersion.get());
   644 		const XMLCh* textFromVersion = fromVersion->item(0)->getTextContent();
   574 		const XMLCh* textFromVersion = fromVersion->item(0)->getTextContent();
   645 		componentDependencyDetail.iFromVersion = XMLChToWString(textFromVersion);
   575 		componentDependencyDetail.iFromVersion = std::wstring(textFromVersion);
   646 
   576 
   647 		DOMNodeList* toVersion = currentDepDetail->getElementsByTagName(tagToVersion.get());
   577 		DOMNodeList* toVersion = currentDepDetail->getElementsByTagName(tagToVersion.get());
   648 		const XMLCh* textToVersion = toVersion->item(0)->getTextContent();
   578 		const XMLCh* textToVersion = toVersion->item(0)->getTextContent();
   649 		componentDependencyDetail.iToVersion = XMLChToWString(textToVersion);
   579 		componentDependencyDetail.iToVersion = std::wstring(textToVersion);
   650 
   580 
   651 		componentDependency.iComponentDependencyList.push_back(componentDependencyDetail);
   581 		componentDependency.iComponentDependencyList.push_back(componentDependencyDetail);
   652 		
   582 		
   653 		}
   583 		}
   654 	
   584 	
   655 	// attribute - location
   585 	// attribute - location
   656 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   586 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   657 	DOMNode* dependentId = attributes->getNamedItem(tagDependentId.get());
   587 	DOMNode* dependentId = attributes->getNamedItem(tagDependentId.get());
   658 	componentDependency.iDependentId = XMLChToWString(dependentId->getTextContent());
   588 	componentDependency.iDependentId = dependentId->getTextContent();
   659 	LOGEXIT("CScrXmlParser::GetComponentDependency()");
   589 	
   660 	return componentDependency;
   590 	return componentDependency;
   661 	}
   591 	}
   662 
   592 
   663 XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty 
   593 XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty 
   664 	CScrXmlParser::GetFileProperty( const DOMElement* aDOMElement)
   594 	CScrXmlParser::GetFileProperty( const DOMElement* aDOMElement)
   665 	{
   595 	{
   666 	LOGENTER("CScrXmlParser::GetFileProperty()");
       
   667 	// tag for FileProperty
   596 	// tag for FileProperty
   668 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyName( &XMLString::release, XMLString::transcode("Name") );
   597 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyName( &XMLString::release, XMLString::transcode("Name") );
   669 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyValue( &XMLString::release, XMLString::transcode("FileProperty_Value") );
   598 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyValue( &XMLString::release, XMLString::transcode("FileProperty_Value") );
   670 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyIsBinary( &XMLString::release, XMLString::transcode("FileProperty_IsBinary") );
   599 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyIsBinary( &XMLString::release, XMLString::transcode("FileProperty_IsBinary") );
   671 
   600 
   681 		
   610 		
   682 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagFilePropertyValue.get());
   611 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagFilePropertyValue.get());
   683 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagFilePropertyIsBinary.get());
   612 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagFilePropertyIsBinary.get());
   684 	
   613 	
   685 	const XMLCh* textName = name->getTextContent();
   614 	const XMLCh* textName = name->getTextContent();
   686 	fileProperty.iName	= XMLChToWString(textName);
   615 	fileProperty.iName	= textName;
   687 		
   616 		
   688 	int valueLength = value->getLength();
   617 	int valueLength = value->getLength();
   689 	if(valueLength != 0)
   618 	if(valueLength != 0)
   690 		{
   619 		{
   691 		for(int valIndex = 0; valIndex< valueLength; ++valIndex)
   620 		for(int valIndex = 0; valIndex< valueLength; ++valIndex)
   697 				{
   626 				{
   698 				DOMElement* valueElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
   627 				DOMElement* valueElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
   699 				if( XMLString::equals(valueElement->getTagName(), tagFilePropertyIntValue.get()))
   628 				if( XMLString::equals(valueElement->getTagName(), tagFilePropertyIntValue.get()))
   700 					{
   629 					{
   701 					fileProperty.iIsIntValue = true;
   630 					fileProperty.iIsIntValue = true;
   702 					fileProperty.iValue = XMLChToWString(currentElement->getTextContent());
   631 					fileProperty.iValue = currentElement->getTextContent();
   703 					}
   632 					}
   704 				else if( XMLString::equals(valueElement->getTagName(), tagFilePropertyStrValue.get()))
   633 				else if( XMLString::equals(valueElement->getTagName(), tagFilePropertyStrValue.get()))
   705 					{
   634 					{
   706 					fileProperty.iIsIntValue = false;
   635 					fileProperty.iIsIntValue = false;
   707 					fileProperty.iValue = XMLChToWString(currentElement->getTextContent());
   636 					fileProperty.iValue = currentElement->getTextContent();
   708 					}
   637 					}
   709 				}
   638 				}
   710 			}
   639 			}
   711 		}
   640 		}
   712 	LOGEXIT("CScrXmlParser::GetFileProperty()");
       
   713 	return fileProperty;
   641 	return fileProperty;
   714 	}
   642 	}
   715 		
   643 		
   716 XmlDetails::TScrPreProvisionDetail::TComponentDetails 
   644 XmlDetails::TScrPreProvisionDetail::TComponentDetails 
   717 	CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement)
   645 	CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement)
   718 	{
   646 	{
   719 	LOGENTER("CScrXmlParser::GetComponentDetails()");
       
   720 	// tags for ComponentDetails
   647 	// tags for ComponentDetails
   721 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRomApplication( &XMLString::release, XMLString::transcode("RomApplication") );
       
   722 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") );
   648 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") );
   723 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") );
   649 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") );
   724 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") );
   650 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") );
   725 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") );
   651 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") );
   726 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") );
   652 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") );
   727 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") );
   653 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") );
   728 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") );
   654 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") );
   729 	
   655 	
   730 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails;
   656 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails;
   731 	
   657 	
   732 	DOMNodeList* romApplication	= aDOMElement->getElementsByTagName(tagRomApplication.get());
       
   733 	DOMNodeList* removable	= aDOMElement->getElementsByTagName(tagRemovable.get());
   658 	DOMNodeList* removable	= aDOMElement->getElementsByTagName(tagRemovable.get());
   734 	DOMNodeList* size		= aDOMElement->getElementsByTagName(tagSize.get());
   659 	DOMNodeList* size		= aDOMElement->getElementsByTagName(tagSize.get());
   735 	DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get());
   660 	DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get());
   736 	DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get());
   661 	DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get());
   737 	DOMNodeList* versionDetail	= aDOMElement->getElementsByTagName(tagVersion.get());
   662 	DOMNodeList* versionDetail	= aDOMElement->getElementsByTagName(tagVersion.get());
   738 	DOMNodeList* originVerified	= aDOMElement->getElementsByTagName(tagOriginVerified.get());
   663 	DOMNodeList* originVerified	= aDOMElement->getElementsByTagName(tagOriginVerified.get());
   739 	DOMNodeList* hidden	= aDOMElement->getElementsByTagName(tagHidden.get());
   664 	DOMNodeList* hidden	= aDOMElement->getElementsByTagName(tagHidden.get());
   740 	
   665 	
   741 	if( romApplication->getLength() != 0)
       
   742 		{
       
   743 		LOGINFO("CScrXmlParser::GetComponentDetails()- rom app");
       
   744 		const XMLCh* textRomApplication = romApplication->item(0)->getTextContent();
       
   745 		componentDetails.iIsRomApplication = XercesStringToInteger(textRomApplication);
       
   746 		}
       
   747 
       
   748 	if( removable->getLength() != 0)
   666 	if( removable->getLength() != 0)
   749 		{
   667 		{
   750 		const XMLCh* textRemovable = removable->item(0)->getTextContent();
   668 		const XMLCh* textRemovable = removable->item(0)->getTextContent();
   751 		componentDetails.iIsRemovable = XercesStringToInteger(textRemovable);
   669 		componentDetails.iIsRemovable = Util::WideCharToInteger(textRemovable);
   752 		}
   670 		}
   753 	
   671 	
   754 	if( size->getLength() != 0)
   672 	if( size->getLength() != 0)
   755 		{
   673 		{
   756 		const XMLCh* textSize = size->item(0)->getTextContent();
   674 		const XMLCh* textSize = size->item(0)->getTextContent();
   757 		componentDetails.iSize = XercesStringToInteger(textSize);
   675 		componentDetails.iSize = Util::WideCharToInteger(textSize);
   758 		}
   676 		}
   759 	
   677 	
   760 	if( scomoState->getLength() != 0)
   678 	if( scomoState->getLength() != 0)
   761 		{
   679 		{
   762 		const XMLCh* textScomoState = scomoState->item(0)->getTextContent();
   680 		const XMLCh* textScomoState = scomoState->item(0)->getTextContent();
   763 		componentDetails.iScomoState = XercesStringToInteger(textScomoState);
   681 		componentDetails.iScomoState = Util::WideCharToInteger(textScomoState);
   764 		}
   682 		}
   765 	
   683 	
   766 	if( globalId->getLength() != 0)
   684 	if( globalId->getLength() != 0)
   767 		{
   685 		{
   768 		const XMLCh* textGlobalId = globalId->item(0)->getTextContent();
   686 		const XMLCh* textGlobalId = globalId->item(0)->getTextContent();
   769 		componentDetails.iGlobalId = XMLChToWString(textGlobalId);
   687 		componentDetails.iGlobalId = textGlobalId;
   770 		}
   688 		}
   771 
   689 
   772 	if( versionDetail->getLength() != 0)
   690 	if( versionDetail->getLength() != 0)
   773 		{
   691 		{
   774 		// tags for Version
   692 		// tags for Version
   780 		DOMNamedNodeMap* attributes = versionElement->getAttributes();
   698 		DOMNamedNodeMap* attributes = versionElement->getAttributes();
   781 		DOMNode* major = attributes->getNamedItem(tagMajor.get());
   699 		DOMNode* major = attributes->getNamedItem(tagMajor.get());
   782 		DOMNode* minor = attributes->getNamedItem(tagMinor.get());
   700 		DOMNode* minor = attributes->getNamedItem(tagMinor.get());
   783 		DOMNode* build = attributes->getNamedItem(tagBuild.get());
   701 		DOMNode* build = attributes->getNamedItem(tagBuild.get());
   784 
   702 
   785 		componentDetails.iVersion.iMajor = XMLChToWString(major->getTextContent());
   703 		componentDetails.iVersion.iMajor = major->getTextContent();
   786 		componentDetails.iVersion.iMinor = XMLChToWString(minor->getTextContent());
   704 		componentDetails.iVersion.iMinor = minor->getTextContent();
   787 		componentDetails.iVersion.iBuild = XMLChToWString(build->getTextContent());
   705 		componentDetails.iVersion.iBuild = build->getTextContent();
   788 		}
   706 		}
   789 	
   707 	
   790 	if( originVerified->getLength() != 0)
   708 	if( originVerified->getLength() != 0)
   791 		{
   709 		{
   792 		const XMLCh* textOriginVerified = originVerified->item(0)->getTextContent();
   710 		const XMLCh* textOriginVerified = originVerified->item(0)->getTextContent();
   793 		componentDetails.iOriginVerified = XercesStringToInteger(textOriginVerified);
   711 		componentDetails.iOriginVerified = Util::WideCharToInteger(textOriginVerified);
   794 		}
   712 		}
   795 	
   713 	
   796 	if( hidden->getLength() != 0)
   714 	if( hidden->getLength() != 0)
   797 		{
   715 		{
   798 		const XMLCh* textHidden = hidden->item(0)->getTextContent();
   716 		const XMLCh* textHidden = hidden->item(0)->getTextContent();
   799 		componentDetails.iIsHidden = XercesStringToInteger(textHidden);
   717 		componentDetails.iIsHidden = Util::WideCharToInteger(textHidden);
   800 		}
   718 		}
   801 	LOGEXIT("CScrXmlParser::GetComponentDetails()");
   719 	
   802 	return componentDetails;
   720 	return componentDetails;
   803 	}
   721 	}
   804 
   722 
   805 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName 
   723 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName 
   806 	CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement)
   724 	CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement)
   807 	{
   725 	{
   808 	LOGENTER("CScrXmlParser::GetLocalizedSoftwareTypeName()");
       
   809 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") );
   726 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") );
   810 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") );
   727 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") );
   811 	
   728 	
   812 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   729 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   813 	DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get());
   730 	DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get());
   814 	DOMNode* name = attributes->getNamedItem(tagSwTypeNameValue.get());
   731 	DOMNode* name = attributes->getNamedItem(tagSwTypeNameValue.get());
   815 
   732 
   816 	XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName localizedSwTypeName;
   733 	XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName localizedSwTypeName;
   817 
   734 
   818 	const XMLCh* textLocale = locale->getTextContent();
   735 	const XMLCh* textLocale = locale->getTextContent();
   819 	localizedSwTypeName.iLocale = XercesStringToInteger(textLocale);
   736 	localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale);
   820 	
   737 	
   821 	const XMLCh* textName = name->getTextContent();
   738 	const XMLCh* textName = name->getTextContent();
   822 	localizedSwTypeName.iName =  XMLChToWString(textName);
   739 	localizedSwTypeName.iName = textName;
   823 	LOGEXIT("CScrXmlParser::GetLocalizedSoftwareTypeName()");
   740 
   824 	return localizedSwTypeName;
   741 	return localizedSwTypeName;
   825 	}
       
   826 
       
   827 XmlDetails::TScrEnvironmentDetails::TCustomAcessList 
       
   828 	CScrXmlParser::GetCustomAcessList(const DOMElement* aDOMElement)
       
   829 	{
       
   830 	LOGENTER("CScrXmlParser::GetCustomAcessList()");
       
   831 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSecureId( &XMLString::release, XMLString::transcode("SecureId") );
       
   832 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAccessMode( &XMLString::release, XMLString::transcode("AccessMode") );
       
   833 	
       
   834 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
   835 	DOMNode* secureId = attributes->getNamedItem(tagSecureId.get());
       
   836 	DOMNode* accessMode = attributes->getNamedItem(tagAccessMode.get());
       
   837 	
       
   838 	XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessList;
       
   839 
       
   840 	fn_auto_ptr<releaseChPtr,char> textSecureId(&XMLString::release, XMLString::transcode(secureId->getTextContent()));
       
   841 	int secureIdVal=0;	
       
   842 	sscanf(textSecureId.get(),"%x",&secureIdVal);
       
   843 	customAcessList.iSecureId = secureIdVal;
       
   844 	
       
   845 	const XMLCh* textAccessMode = accessMode->getTextContent();
       
   846 	customAcessList.iAccessMode = XercesStringToInteger(textAccessMode);
       
   847 	LOGEXIT("CScrXmlParser::GetCustomAcessList()");
       
   848 	return customAcessList;
       
   849 	}
       
   850 
       
   851 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo CScrXmlParser::GetApplicationRegistrationInfo(const DOMElement* aDOMElement)
       
   852 	{
       
   853 	LOGENTER("CScrXmlParser::GetApplicationRegistrationInfo()");
       
   854 	// tags in ApplicationRegistrationInfo
       
   855 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppAttribute( &XMLString::release, XMLString::transcode("ApplicationAttribute") );
       
   856 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoOpaqueData ( &XMLString::release, XMLString::transcode("OpaqueData") );
       
   857 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoFileOwnershipInfo( &XMLString::release, XMLString::transcode("FileOwnershipinfo") );
       
   858 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
       
   859 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppServiceInfo( &XMLString::release, XMLString::transcode("ApplicationServiceInfo") );
       
   860 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppLocalizableInfo( &XMLString::release, XMLString::transcode("ApplicationLocalizableInfo") );
       
   861 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppProperty( &XMLString::release, XMLString::transcode("ApplicationProperty") );
       
   862 
       
   863 	DOMNodeList* appAttributes = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppAttribute.get());
       
   864 	const XMLSize_t appAttributeCount = appAttributes->getLength();
       
   865 	DOMNodeList* OpaqueData	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoOpaqueData.get());
       
   866 	const XMLSize_t OpaqueDataCount = OpaqueData->getLength();
       
   867 	DOMNodeList* fileOwnershipInfos	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoFileOwnershipInfo.get());
       
   868 	const XMLSize_t fileOwnershipInfoCount = fileOwnershipInfos->getLength();
       
   869 	DOMNodeList* appServiceInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppServiceInfo.get());
       
   870 	const XMLSize_t appServiceInfoCount = appServiceInfos->getLength();
       
   871 	DOMNodeList* appLocalizableInfos	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppLocalizableInfo.get());
       
   872 	const XMLSize_t appLocalizableInfoCount = appLocalizableInfos->getLength();
       
   873 	DOMNodeList* appProperties = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppProperty.get());
       
   874 	const XMLSize_t appPropertyCount = appProperties->getLength();
       
   875 
       
   876 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo;
       
   877 
       
   878 	// for each AppAttribute retrieve all tags
       
   879 	for( XMLSize_t index = 0; index < appAttributeCount; ++index )
       
   880 		{
       
   881 		DOMElement* currentappAttribute = static_cast< xercesc::DOMElement* >( appAttributes->item(index) );
       
   882 		
       
   883 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute = GetAppAttribute(currentappAttribute);
       
   884 		appRegistrationInfo.iApplicationAttribute.push_back(appAttribute);
       
   885 		}
       
   886 
       
   887 	// for each OpaqueData retrieve all tags
       
   888 	for( XMLSize_t index = 0; index < OpaqueDataCount; ++index )
       
   889 		{
       
   890 		DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( OpaqueData->item(index) );
       
   891 		
       
   892 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
   893 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetOpaqueDataType(currentOpaqueData);
       
   894 
       
   895 		appProperty.iLocale = opaqueDataType.iLocale;
       
   896 		appProperty.iName = L"OpaqueData";
       
   897 		appProperty.iIntValue = 0;
       
   898 		appProperty.iIsStr8Bit = true;
       
   899 		appProperty.iServiceUid = 0;
       
   900 
       
   901 		if(opaqueDataType.iIsBinary == 1)
       
   902 		{
       
   903 			std::string str = wstring2string(opaqueDataType.iOpaqueData);
       
   904 			std::string decodedString = Util::Base64Decode(str);
       
   905 			int len = decodedString.length();
       
   906 			appProperty.iStrValue.assign(decodedString.c_str(),decodedString.c_str()+len);
       
   907 		}
       
   908 		else
       
   909 		{
       
   910 			appProperty.iStrValue = opaqueDataType.iOpaqueData;
       
   911 		}
       
   912 		
       
   913 		appRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
   914 		}
       
   915 
       
   916 	// for each FileOwnershipInfo retrieve all tags
       
   917 	for( XMLSize_t index = 0; index < fileOwnershipInfoCount; ++index )
       
   918 		{
       
   919 		DOMElement* currentFileOwnershipInfo = static_cast< xercesc::DOMElement* >( fileOwnershipInfos->item(index) );
       
   920 
       
   921 		std::wstring file = GetFileOwnershipInfo(currentFileOwnershipInfo);
       
   922 
       
   923 		appRegistrationInfo.iFileOwnershipInfo.push_back(file);
       
   924 		}
       
   925 
       
   926 	// for each appServiceInfo retrieve all tags
       
   927 	for( XMLSize_t index = 0; index < appServiceInfoCount; ++index )
       
   928 		{
       
   929 		DOMElement* currentappServiceInfo = static_cast< xercesc::DOMElement* >( appServiceInfos->item(index) );
       
   930 		
       
   931 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo = GetAppServiceInfo(currentappServiceInfo, appRegistrationInfo);
       
   932 		appRegistrationInfo.iApplicationServiceInfo.push_back(appServiceInfo);
       
   933 		}
       
   934 
       
   935 	// for each appLocalizableInfo retrieve all tags
       
   936 	for( XMLSize_t index = 0; index < appLocalizableInfoCount; ++index )
       
   937 		{
       
   938 		DOMElement* currentAppLocalizableInfo = static_cast< xercesc::DOMElement* >( appLocalizableInfos->item(index) );
       
   939 		
       
   940 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo = GetAppLocalizableInfo(currentAppLocalizableInfo);
       
   941 		appRegistrationInfo.iApplicationLocalizableInfo.push_back(appLocalizableInfo);
       
   942 		}
       
   943 
       
   944 	// for each AppProperty retrieve all tags
       
   945 	for( XMLSize_t index = 0; index < appPropertyCount; ++index )
       
   946 		{
       
   947 		DOMElement* currentAppProperty = static_cast< xercesc::DOMElement* >( appProperties->item(index) );
       
   948 		
       
   949 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty = GetAppProperty(currentAppProperty);
       
   950 		appRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
   951 		}
       
   952 	LOGEXIT("CScrXmlParser::GetApplicationRegistrationInfo()");
       
   953 	return appRegistrationInfo;
       
   954 	}
       
   955 
       
   956 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute 
       
   957 	CScrXmlParser::GetAppAttribute( const DOMElement* aDOMElement)
       
   958 	{
       
   959 	LOGENTER("CScrXmlParser::GetAppAttribute()");
       
   960 	// tags in AppAttribute
       
   961 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeName( &XMLString::release, XMLString::transcode("Name") );
       
   962 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_Value") );
       
   963 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeIsBinary( &XMLString::release, XMLString::transcode("ApplicationAttribute_IsBinary") );
       
   964 		
       
   965 	// tags of ComponentProperty_Value
       
   966 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeIntValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_IntValue") );
       
   967 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeStrValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_StrValue") );
       
   968 	
       
   969 	// attribute - name
       
   970 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
   971 	DOMNode* name = attributes->getNamedItem(tagAppAttributeName.get());
       
   972 		
       
   973 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppAttributeValue.get());
       
   974 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppAttributeIsBinary.get());
       
   975 	
       
   976 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute;
       
   977 	
       
   978 	const XMLCh* textName = name->getTextContent();
       
   979 	appAttribute.iName	= XMLChToWString(textName);
       
   980 	
       
   981 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
   982 	const XMLSize_t nodeCount = childNodes->getLength();
       
   983 
       
   984 	for(int index = 0; index< nodeCount; ++index)
       
   985 		{
       
   986 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
       
   987 		if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeIntValue.get()))
       
   988 			{
       
   989 			appAttribute.iIsIntValue = true;
       
   990 			appAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
   991 			break;
       
   992 			}
       
   993 		else if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeStrValue.get()))
       
   994 			{
       
   995 			appAttribute.iIsIntValue = false;
       
   996 			appAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
   997 			break;
       
   998 			}
       
   999 		}
       
  1000 		
       
  1001 	if(isBinary->getLength() != 0)
       
  1002 		{
       
  1003 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1004 		appAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
       
  1005 		}
       
  1006 	LOGEXIT("CScrXmlParser::GetAppAttribute()");
       
  1007 	return appAttribute;
       
  1008 	}
       
  1009 
       
  1010 std::wstring CScrXmlParser::GetFileOwnershipInfo( const DOMElement* aDOMElement)
       
  1011 	{
       
  1012 	LOGENTER("CScrXmlParser::GetFileOwnershipInfo()");
       
  1013 	// tags in FileOwnershipInfo 
       
  1014 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileName( &XMLString::release, XMLString::transcode("FileName") );
       
  1015 
       
  1016 	DOMNodeList* fileName = aDOMElement->getElementsByTagName(tagFileName.get());
       
  1017 	
       
  1018 	std::wstring file;
       
  1019 
       
  1020 	if( fileName->getLength() != 0)
       
  1021 		{
       
  1022 		const XMLCh* fil = fileName->item(0)->getTextContent();
       
  1023 		file = XMLChToWString(fil);
       
  1024 		}
       
  1025 
       
  1026 	LOGEXIT("CScrXmlParser::GetFileOwnershipInfo()");
       
  1027 	return file;
       
  1028 	}
       
  1029 
       
  1030 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType 
       
  1031 	CScrXmlParser::GetDataType( const DOMElement* aDOMElement)
       
  1032 	{
       
  1033 	LOGENTER("CScrXmlParser::GetDataType()");
       
  1034 	// tags in DataType 
       
  1035 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataTypePriority( &XMLString::release, XMLString::transcode("Priority") );
       
  1036 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataType( &XMLString::release, XMLString::transcode("Type") );
       
  1037 
       
  1038 	DOMNodeList* priority = aDOMElement->getElementsByTagName(tagDataTypePriority.get());
       
  1039 	DOMNodeList* type = aDOMElement->getElementsByTagName(tagDataType.get());
       
  1040 	
       
  1041 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType;
       
  1042 
       
  1043 	if( priority->getLength() != 0)
       
  1044 		{
       
  1045 		const XMLCh* pri = priority->item(0)->getTextContent();
       
  1046 		dataType.iPriority = XercesStringToInteger(pri);
       
  1047 		}
       
  1048 
       
  1049 	if( type->getLength() != 0)
       
  1050 		{
       
  1051 		const XMLCh* typ = type->item(0)->getTextContent();
       
  1052 		dataType.iType = XMLChToWString(typ);
       
  1053 		}
       
  1054 	LOGEXIT("CScrXmlParser::GetDataType()");
       
  1055 	return dataType;
       
  1056 	}
       
  1057 
       
  1058 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType 
       
  1059 	CScrXmlParser::GetOpaqueDataType( const DOMElement* aDOMElement)
       
  1060 	{
       
  1061 	LOGENTER("CScrXmlParser::GetOpaqueDataType()");
       
  1062 	// tags in OpaqueDataType 
       
  1063 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagData( &XMLString::release, XMLString::transcode("Data") );
       
  1064 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOpaqueLocale( &XMLString::release, XMLString::transcode("OpaqueLocale") );
       
  1065 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagIsBinary( &XMLString::release, XMLString::transcode("IsBinary") );
       
  1066 
       
  1067 	DOMNodeList* Data = aDOMElement->getElementsByTagName(tagData.get());
       
  1068 	DOMNodeList* OpaqueLocale = aDOMElement->getElementsByTagName(tagOpaqueLocale.get());
       
  1069 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagIsBinary.get());
       
  1070 	
       
  1071 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
       
  1072 
       
  1073 	if( OpaqueLocale->getLength() != 0)
       
  1074 		{
       
  1075 		const XMLCh* pri = OpaqueLocale->item(0)->getTextContent();
       
  1076 		opaqueDataType.iLocale = XercesStringToInteger(pri);
       
  1077 		}
       
  1078 
       
  1079 	if( Data->getLength() != 0)
       
  1080 		{
       
  1081 		const XMLCh* typ = Data->item(0)->getTextContent();
       
  1082 		opaqueDataType.iOpaqueData = XMLChToWString(typ);
       
  1083 		}
       
  1084 	
       
  1085 	if(isBinary->getLength() != 0)
       
  1086 		{
       
  1087 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1088 		opaqueDataType.iIsBinary = XercesStringToInteger(textIsBinary);		
       
  1089 		}
       
  1090 
       
  1091 	LOGEXIT("CScrXmlParser::GetOpaqueDataType()");
       
  1092 	return opaqueDataType;
       
  1093 	}
       
  1094 
       
  1095 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType 
       
  1096 	CScrXmlParser::GetServiceOpaqueDataType( const DOMElement* aDOMElement)
       
  1097 	{
       
  1098 	LOGENTER("CScrXmlParser::GetServiceOpaqueDataType()");
       
  1099 	// tags in OpaqueDataType 
       
  1100 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceData( &XMLString::release, XMLString::transcode("ServiceData") );
       
  1101 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceOpaqueLocale( &XMLString::release, XMLString::transcode("ServiceOpaqueLocale") );
       
  1102 
       
  1103 	DOMNodeList* ServiceData = aDOMElement->getElementsByTagName(tagServiceData.get());
       
  1104 	DOMNodeList* ServiceOpaqueLocale = aDOMElement->getElementsByTagName(tagServiceOpaqueLocale.get());
       
  1105 	
       
  1106 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
       
  1107 
       
  1108 	if( ServiceOpaqueLocale->getLength() != 0)
       
  1109 		{
       
  1110 		const XMLCh* pri = ServiceOpaqueLocale->item(0)->getTextContent();
       
  1111 		opaqueDataType.iLocale = XercesStringToInteger(pri);
       
  1112 		}
       
  1113 
       
  1114 	if( ServiceData->getLength() != 0)
       
  1115 		{
       
  1116 		const XMLCh* typ = ServiceData->item(0)->getTextContent();
       
  1117 		opaqueDataType.iOpaqueData = XMLChToWString(typ);
       
  1118 		}
       
  1119 	LOGEXIT("CScrXmlParser::GetServiceOpaqueDataType()");
       
  1120 	return opaqueDataType;
       
  1121 	}
       
  1122 
       
  1123 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo 
       
  1124 	CScrXmlParser::GetAppServiceInfo( const DOMElement* aDOMElement, XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo& aAppRegistrationInfo )
       
  1125 	{
       
  1126 	LOGENTER("CScrXmlParser::GetAppServiceInfo()");
       
  1127 	// tags in AppServiceInfo
       
  1128 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoUid( &XMLString::release, XMLString::transcode("Uid") );
       
  1129 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceAppProperty( &XMLString::release, XMLString::transcode("ServiceOpaqueData") );
       
  1130 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
       
  1131 
       
  1132 	DOMNodeList* uid = aDOMElement->getElementsByTagName(tagAppServiceInfoUid.get());
       
  1133 
       
  1134 	DOMNodeList* ServiceOpaqueData = aDOMElement->getElementsByTagName(tagAppServiceAppProperty.get());
       
  1135 	const XMLSize_t ServiceOpaqueDataCount = ServiceOpaqueData->getLength();
       
  1136 	
       
  1137 	DOMNodeList* dataTypes = aDOMElement->getElementsByTagName(tagAppServiceInfoDataType.get());
       
  1138 	const XMLSize_t dataTypeCount = dataTypes->getLength();
       
  1139 
       
  1140 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo;
       
  1141 
       
  1142 	if( uid->getLength() != 0)
       
  1143 		{
       
  1144 		const XMLCh* priority = uid->item(0)->getTextContent();
       
  1145 		appServiceInfo.iUid = XercesStringToInteger(priority);
       
  1146 		}
       
  1147 
       
  1148 	// for each OpaqueData retrieve all tags
       
  1149 	for( XMLSize_t index = 0; index < ServiceOpaqueDataCount; ++index )
       
  1150 		{
       
  1151 		DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( ServiceOpaqueData->item(index) );
       
  1152 		
       
  1153 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
  1154 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetServiceOpaqueDataType(currentOpaqueData);
       
  1155 
       
  1156 		appProperty.iLocale = opaqueDataType.iLocale;
       
  1157 		appProperty.iName = L"OpaqueData";
       
  1158 		appProperty.iIntValue = 0;
       
  1159 		appProperty.iIsStr8Bit = true;
       
  1160 		appProperty.iServiceUid = appServiceInfo.iUid;
       
  1161 		if(opaqueDataType.iIsBinary == 1)
       
  1162 		{
       
  1163 			std::string str = wstring2string(opaqueDataType.iOpaqueData);
       
  1164 			std::string decodedString = Util::Base64Decode(str);
       
  1165 			appProperty.iStrValue = string2wstring(decodedString);
       
  1166 		}
       
  1167 		else
       
  1168 		{
       
  1169 			appProperty.iStrValue = opaqueDataType.iOpaqueData;
       
  1170 		}
       
  1171 		aAppRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
  1172 		}
       
  1173 
       
  1174 	// for each DataType retrieve all tags
       
  1175 	for( XMLSize_t index = 0; index < dataTypeCount; ++index )
       
  1176 		{
       
  1177 		DOMElement* currentDataType = static_cast< xercesc::DOMElement* >( dataTypes->item(index) );
       
  1178 		
       
  1179 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType = GetDataType(currentDataType);
       
  1180 		appServiceInfo.iDataType.push_back(dataType);
       
  1181 		}
       
  1182 	LOGEXIT("CScrXmlParser::GetAppServiceInfo()");
       
  1183 	return appServiceInfo;
       
  1184 
       
  1185 	}
       
  1186 
       
  1187 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo 
       
  1188 	CScrXmlParser::GetAppLocalizableInfo( const DOMElement* aDOMElement)
       
  1189 	{
       
  1190 	LOGENTER("CScrXmlParser::GetAppLocalizableInfo()");
       
  1191 	// tags in AppLocalizableInfo  
       
  1192 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttribute( &XMLString::release, XMLString::transcode("LocalizableAttribute") );
       
  1193 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewData ( &XMLString::release, XMLString::transcode("ViewData") );
       
  1194 	
       
  1195 	DOMNodeList* localizableAttributes = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttribute.get());
       
  1196 	const XMLSize_t attributeCount = localizableAttributes->getLength();
       
  1197 	DOMNodeList* viewData = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewData.get());
       
  1198 	const XMLSize_t viewDataCount = viewData->getLength();
       
  1199 
       
  1200 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo;
       
  1201 
       
  1202 	LOGINFO("for each AppLocalizableInfoAttribute retrieve all tags");
       
  1203 	// for each AppLocalizableInfoAttribute retrieve all tags
       
  1204 	for( XMLSize_t index = 0; index < attributeCount; ++index )
       
  1205 		{
       
  1206 		DOMElement* currentLocalizableAttribute = static_cast< xercesc::DOMElement* >( localizableAttributes->item(index) );
       
  1207 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute = GetAppLocalizableAttribute(currentLocalizableAttribute);
       
  1208 		appLocalizableInfo.iLocalizableAttribute.push_back(appLocalizableAttribute);
       
  1209 		}
       
  1210 
       
  1211 	LOGINFO("for each AppLocalizableViewData retrieve all tags");
       
  1212 	// for each AppLocalizableViewData retrieve all tags
       
  1213 	
       
  1214 	for( XMLSize_t index = 0; index < viewDataCount; ++index )
       
  1215 		{
       
  1216 		DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewData->item(index) );
       
  1217 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appLocalizableViewData = GetAppLocalizableViewData(currentLocalizableViewData);
       
  1218 		LOGINFO("push_back viewdata");
       
  1219 		appLocalizableInfo.iViewData.push_back(appLocalizableViewData);
       
  1220 		}
       
  1221 
       
  1222 	LOGEXIT("CScrXmlParser::GetAppLocalizableInfo()");
       
  1223 	return appLocalizableInfo;
       
  1224 	}
       
  1225 
       
  1226 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute 
       
  1227 	CScrXmlParser::GetAppLocalizableAttribute( const DOMElement* aDOMElement)
       
  1228 	{
       
  1229 	LOGENTER("CScrXmlParser::GetAppLocalizableAttribute()");
       
  1230 	// tags in AppLocalizableInfo  
       
  1231 	// tags in AppLocalizableInfoAttribute
       
  1232 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeName( &XMLString::release, XMLString::transcode("Name") );
       
  1233 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_Value") );
       
  1234 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIsBinary( &XMLString::release, XMLString::transcode("LocalizableAttribute_IsBinary") );
       
  1235 		
       
  1236 	// tags of AppLocalizableInfoAttribute_Value
       
  1237 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIntValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_IntValue") );
       
  1238 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeStrValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_StrValue") );
       
  1239 	
       
  1240 	LOGINFO("attribute - name");
       
  1241 	// attribute - name
       
  1242 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
  1243 	DOMNode* name = attributes->getNamedItem(tagAppLocalizableInfoAttributeName.get());
       
  1244 		
       
  1245 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeValue.get());
       
  1246 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeIsBinary.get());
       
  1247 	
       
  1248 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute;
       
  1249 	
       
  1250 	LOGINFO("name->getTextContent");
       
  1251 	const XMLCh* textName = name->getTextContent();
       
  1252 	appLocalizableAttribute.iName = XMLChToWString(textName);
       
  1253 	
       
  1254 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
  1255 	const XMLSize_t nodeCount = childNodes->getLength();
       
  1256 
       
  1257 	for(int index = 0; index< nodeCount; ++index)
       
  1258 		{
       
  1259 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
       
  1260 		if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeIntValue.get()))
       
  1261 			{
       
  1262 			appLocalizableAttribute.iIsIntValue = true;
       
  1263 			appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
  1264 			break;
       
  1265 			}
       
  1266 		else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeStrValue.get()))
       
  1267 			{
       
  1268 			appLocalizableAttribute.iIsIntValue = false;
       
  1269 			appLocalizableAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
  1270 			break;
       
  1271 			}
       
  1272 		}
       
  1273 		
       
  1274 	if(isBinary->getLength() != 0)
       
  1275 		{
       
  1276 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1277 		appLocalizableAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
       
  1278 		}
       
  1279 
       
  1280 	LOGEXIT("CScrXmlParser::GetAppLocalizableAttribute()");
       
  1281 	return appLocalizableAttribute;
       
  1282 	}
       
  1283 
       
  1284 
       
  1285 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData 
       
  1286 	CScrXmlParser::GetAppLocalizableViewData( const DOMElement* aDOMElement)
       
  1287 	{
       
  1288 	LOGENTER("CScrXmlParser::GetAppLocalizableViewData()");
       
  1289 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewDataAttribute ( &XMLString::release, XMLString::transcode("ViewDataAttribute") );
       
  1290 
       
  1291 	DOMNodeList* viewDataAttr = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewDataAttribute.get());
       
  1292 	const XMLSize_t viewDataAttrCount = viewDataAttr->getLength();
       
  1293 	
       
  1294 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appViewData;
       
  1295 
       
  1296 	for( XMLSize_t index = 0; index < viewDataAttrCount; ++index )
       
  1297 	{
       
  1298 		DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewDataAttr->item(index) );
       
  1299 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewData = GetAppLocalizableViewDataAttributes(currentLocalizableViewData);
       
  1300 		LOGINFO("push_back viewdata");
       
  1301 		appViewData.iViewDataAttributes.push_back(appLocalizableViewData);
       
  1302 	}
       
  1303 	LOGEXIT("CScrXmlParser::GetAppLocalizableViewData()");
       
  1304 	return appViewData;
       
  1305 	}
       
  1306 
       
  1307 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes 
       
  1308 	CScrXmlParser::GetAppLocalizableViewDataAttributes( const DOMElement* aDOMElement)
       
  1309 	{
       
  1310 	LOGENTER("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
       
  1311 	// tags in AppLocalizableViewData
       
  1312 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataName( &XMLString::release, XMLString::transcode("Name") );
       
  1313 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataValue( &XMLString::release, XMLString::transcode("ViewData_Value") );
       
  1314 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIsBinary( &XMLString::release, XMLString::transcode("ViewData_IsBinary") );
       
  1315 		
       
  1316 	// tags of AppLocalizableViewData_Value
       
  1317 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIntValue( &XMLString::release, XMLString::transcode("ViewData_IntValue") );
       
  1318 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataStrValue( &XMLString::release, XMLString::transcode("ViewData_StrValue") );
       
  1319 		
       
  1320 	LOGINFO("attribute - name");
       
  1321 	// attribute - name
       
  1322 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
  1323 	DOMNode* name = attributes->getNamedItem(tagAppLocalizableViewDataName.get());
       
  1324 		
       
  1325 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataValue.get());
       
  1326 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataIsBinary.get());
       
  1327 	
       
  1328 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewDataAttribute;
       
  1329 	
       
  1330 	LOGINFO("name->getTextContent");
       
  1331 	const XMLCh* textName = name->getTextContent();
       
  1332 	LOGINFO("assign name");
       
  1333 	appLocalizableViewDataAttribute.iName = XMLChToWString(textName);
       
  1334 
       
  1335 	LOGINFO("getChildNodes()");
       
  1336 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
  1337 	LOGINFO("childNodes->getLength()");
       
  1338 	const XMLSize_t nodeCount = childNodes->getLength();
       
  1339 
       
  1340 	for(int index = 0; index< nodeCount; ++index)
       
  1341 		{
       
  1342 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
       
  1343 		if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataIntValue.get()))
       
  1344 			{
       
  1345 			LOGINFO("int value");
       
  1346 			appLocalizableViewDataAttribute.iIsIntValue = true;
       
  1347 			appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
  1348 			break;
       
  1349 			}
       
  1350 		else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataStrValue.get()))
       
  1351 			{
       
  1352 			LOGINFO("str value");
       
  1353 			appLocalizableViewDataAttribute.iIsIntValue = false;
       
  1354 			appLocalizableViewDataAttribute.iValue = XMLChToWString(currentElement->getTextContent());
       
  1355 			break;
       
  1356 			}
       
  1357 		}
       
  1358 		
       
  1359 	if(isBinary->getLength() != 0)
       
  1360 		{
       
  1361 		LOGINFO("bin value");
       
  1362 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1363 		appLocalizableViewDataAttribute.iIsStr8Bit = XercesStringToInteger(textIsBinary);
       
  1364 		}
       
  1365 	LOGEXIT("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
       
  1366 	return appLocalizableViewDataAttribute;
       
  1367 	}
       
  1368 
       
  1369 
       
  1370 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty 
       
  1371 	CScrXmlParser::GetAppProperty( const DOMElement* aDOMElement)
       
  1372 	{
       
  1373 	LOGENTER("CScrXmlParser::GetAppProperty()");
       
  1374 	// tags in AppProperty
       
  1375 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyLocale( &XMLString::release, XMLString::transcode("Locale") );
       
  1376 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyName( &XMLString::release, XMLString::transcode("Name") );
       
  1377 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyIntValue( &XMLString::release, XMLString::transcode("IntValue") );
       
  1378 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyStrValue( &XMLString::release, XMLString::transcode("StrValue") );
       
  1379 
       
  1380 	DOMNodeList* locale = aDOMElement->getElementsByTagName(tagAppPropertyLocale.get());
       
  1381 	DOMNodeList* name = aDOMElement->getElementsByTagName(tagAppPropertyName.get());
       
  1382 	DOMNodeList* intvalue = aDOMElement->getElementsByTagName(tagAppPropertyIntValue.get());
       
  1383 	DOMNodeList* strvalue = aDOMElement->getElementsByTagName(tagAppPropertyStrValue.get());
       
  1384 	
       
  1385 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
  1386 
       
  1387 	if( locale->getLength() != 0)
       
  1388 		{
       
  1389 		const XMLCh* loc = locale->item(0)->getTextContent();
       
  1390 		appProperty.iLocale = XercesStringToInteger(loc);
       
  1391 		}
       
  1392 
       
  1393 	if( name->getLength() != 0)
       
  1394 		{
       
  1395 		const XMLCh* nam = name->item(0)->getTextContent();
       
  1396 		appProperty.iName = XMLChToWString(nam);
       
  1397 		}
       
  1398 
       
  1399 	if( intvalue->getLength() != 0)
       
  1400 		{
       
  1401 		const XMLCh* intval = intvalue->item(0)->getTextContent();
       
  1402 		appProperty.iIntValue = XercesStringToInteger(intval);
       
  1403 		}
       
  1404 	else if( strvalue->getLength() != 0)
       
  1405 		{
       
  1406 		const XMLCh* strval = strvalue->item(0)->getTextContent();
       
  1407 		appProperty.iStrValue = XMLChToWString(strval);
       
  1408 		}
       
  1409 
       
  1410 	appProperty.iIsStr8Bit = false;
       
  1411 	
       
  1412 	LOGEXIT("CScrXmlParser::GetAppProperty()");
       
  1413 	return appProperty;
       
  1414 	}
   742 	}
  1415 
   743 
  1416 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser)
   744 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser)
  1417 	{
   745 	{
  1418 	aDomParser.setValidationScheme( XercesDOMParser::Val_Always );
   746 	aDomParser.setValidationScheme( XercesDOMParser::Val_Always );
  1457 void SchemaErrorHandler::resetErrors ()
   785 void SchemaErrorHandler::resetErrors ()
  1458 	{
   786 	{
  1459 	std::string msg( "Resetting error handler object" );
   787 	std::string msg( "Resetting error handler object" );
  1460 	LOGINFO(msg);
   788 	LOGINFO(msg);
  1461 	}
   789 	}
  1462 
       
  1463