secureswitools/swisistools/source/xmlparser/xmlparser.cpp
changeset 25 98b66e4fb0be
parent 0 ba25891c3a9e
child 50 c6e8afe0ba85
child 60 245df5276b97
equal deleted inserted replaced
24:84a16765cd86 25:98b66e4fb0be
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 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".
   246 	
   246 	
   247 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeNames( &XMLString::release, XMLString::transcode("SoftwareTypeNames") );
   247 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSoftwareTypeNames( &XMLString::release, XMLString::transcode("SoftwareTypeNames") );
   248 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagUniqueSoftwareTypeName( &XMLString::release, XMLString::transcode("UniqueSoftwareTypeName") );
   248 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagUniqueSoftwareTypeName( &XMLString::release, XMLString::transcode("UniqueSoftwareTypeName") );
   249 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocalizableSwTypeName( &XMLString::release, XMLString::transcode("LocalizableSoftwareTypeName") );
   249 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocalizableSwTypeName( &XMLString::release, XMLString::transcode("LocalizableSoftwareTypeName") );
   250 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSifPluginUid( &XMLString::release, XMLString::transcode("SifPluginUid") );
   250 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSifPluginUid( &XMLString::release, XMLString::transcode("SifPluginUid") );
   251 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagInstallerSid( &XMLString::release, XMLString::transcode("InstallerSid") );
   251 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLauncherExecutable( &XMLString::release, XMLString::transcode("LauncherExecutable") );
   252 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagExecutionLayerSid( &XMLString::release, XMLString::transcode("ExecutionLayerSid") );
   252 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagCustomAcess( &XMLString::release, XMLString::transcode("CustomAcess") );
   253 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEDetails( &XMLString::release, XMLString::transcode("MIMEDetails") );
   253 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEDetails( &XMLString::release, XMLString::transcode("MIMEDetails") );
   254 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEType( &XMLString::release, XMLString::transcode("MIMEType") );
   254 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagMIMEType( &XMLString::release, XMLString::transcode("MIMEType") );
   255 	
   255 	
   256 	DOMNodeList* swTypeNames = aEnvironment->getElementsByTagName(tagSoftwareTypeNames.get());
   256 	DOMNodeList* swTypeNames = aEnvironment->getElementsByTagName(tagSoftwareTypeNames.get());
   257 	DOMNode* swTypeNamesRoot	= swTypeNames->item(0);
   257 	DOMNode* swTypeNamesRoot	= swTypeNames->item(0);
   276 	fn_auto_ptr<releaseChPtr,char> sifPluginUidText(&XMLString::release, XMLString::transcode(textContent));
   276 	fn_auto_ptr<releaseChPtr,char> sifPluginUidText(&XMLString::release, XMLString::transcode(textContent));
   277 	int sifPluginUidValue = 0;
   277 	int sifPluginUidValue = 0;
   278 	sscanf(sifPluginUidText.get(),"%x",&sifPluginUidValue);
   278 	sscanf(sifPluginUidText.get(),"%x",&sifPluginUidValue);
   279 	scrEnvDetails.iSifPluginUid = sifPluginUidValue;
   279 	scrEnvDetails.iSifPluginUid = sifPluginUidValue;
   280 	
   280 	
   281 	DOMNodeList* installerSid = aEnvironment->getElementsByTagName(tagInstallerSid.get());
   281     DOMNodeList* launcherExecutable = aEnvironment->getElementsByTagName(tagLauncherExecutable.get());
   282 	textContent = installerSid->item(0)->getTextContent();
   282     if(0 != launcherExecutable->getLength())
   283 	fn_auto_ptr<releaseChPtr,char> installerSidText(&XMLString::release, XMLString::transcode(textContent));
   283         {
   284 	int installerSidValue = 0;
   284 		textContent = launcherExecutable->item(0)->getTextContent();
   285 	sscanf(installerSidText.get(),"%x",&installerSidValue);
   285 		fn_auto_ptr<releaseXmlChPtr, XMLCh> launcherExecutableText( &XMLString::release,textContent );
   286 	scrEnvDetails.iInstallerSid = installerSidValue;
   286 		const XMLCh* launcherExecutableValue = launcherExecutableText.get();
   287 	
   287 		scrEnvDetails.iLauncherExecutable = launcherExecutableValue;
   288 	DOMNodeList* executionLayerSid = aEnvironment->getElementsByTagName(tagExecutionLayerSid.get());
   288 		}
   289 	textContent = executionLayerSid->item(0)->getTextContent();
   289     DOMNodeList* customAcessList = aEnvironment->getElementsByTagName(tagCustomAcess.get());
   290 	fn_auto_ptr<releaseChPtr,char> executionLayerSidText(&XMLString::release, XMLString::transcode(textContent));
   290 	const  XMLSize_t customAcessDataCount = customAcessList->getLength();
   291 	int executionLayerSidValue = 0;
   291 	for( XMLSize_t count=0 ; count<customAcessDataCount ; ++count )
   292 	sscanf(executionLayerSidText.get(),"%x",&executionLayerSidValue);
   292 		{
   293 	scrEnvDetails.iExecutionLayerSid = executionLayerSidValue;
   293 		DOMNode* customAcessRoot = customAcessList->item(count);
       
   294 		DOMElement* customAcessNode = static_cast< xercesc::DOMElement* >( customAcessRoot );
       
   295 		XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessData = GetCustomAcessList(customAcessNode);
       
   296 		scrEnvDetails.iCustomAcessList.push_back(customAcessData);
       
   297 		}
   294 	
   298 	
   295 	DOMNodeList* mimeDetails = aEnvironment->getElementsByTagName(tagMIMEDetails.get());
   299 	DOMNodeList* mimeDetails = aEnvironment->getElementsByTagName(tagMIMEDetails.get());
   296 	DOMNode* mimeDetailRoot	= mimeDetails->item(0);
   300 	DOMNode* mimeDetailRoot	= mimeDetails->item(0);
   297 	DOMElement* mimeDetailNode = static_cast< xercesc::DOMElement* >( mimeDetailRoot );
   301 	DOMElement* mimeDetailNode = static_cast< xercesc::DOMElement* >( mimeDetailRoot );
   298 	DOMNodeList* mimes = mimeDetailNode->getElementsByTagName(tagMIMEType.get());
   302 	DOMNodeList* mimes = mimeDetailNode->getElementsByTagName(tagMIMEType.get());
   379 	return preProvisionDetail;
   383 	return preProvisionDetail;
   380 	}
   384 	}
   381 
   385 
   382 XmlDetails::TScrPreProvisionDetail::TComponent CScrXmlParser::GetPreProvisionData( const DOMElement* aDOMElement)
   386 XmlDetails::TScrPreProvisionDetail::TComponent CScrXmlParser::GetPreProvisionData( const DOMElement* aDOMElement)
   383 	{
   387 	{
       
   388 	LOGENTER("CScrXmlParser::GetPreProvisionData()");
   384 	XmlDetails::TScrPreProvisionDetail::TComponent component;
   389 	XmlDetails::TScrPreProvisionDetail::TComponent component;
   385 	
   390 	
   386 	DOMNodeList* childNodes = aDOMElement->getChildNodes();
   391 	DOMNodeList* childNodes = aDOMElement->getChildNodes();
   387 	const XMLSize_t nodeCount = childNodes->getLength();
   392 	const XMLSize_t nodeCount = childNodes->getLength();
   388 	
   393 	
   390 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizable( &XMLString::release, XMLString::transcode("ComponentLocalizable") );
   395 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizable( &XMLString::release, XMLString::transcode("ComponentLocalizable") );
   391 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentProperty( &XMLString::release, XMLString::transcode("ComponentProperty") );
   396 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentProperty( &XMLString::release, XMLString::transcode("ComponentProperty") );
   392 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentFile( &XMLString::release, XMLString::transcode("ComponentFile") );
   397 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentFile( &XMLString::release, XMLString::transcode("ComponentFile") );
   393 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDetails( &XMLString::release, XMLString::transcode("ComponentDetails") );
   398 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDetails( &XMLString::release, XMLString::transcode("ComponentDetails") );
   394 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDependency( &XMLString::release, XMLString::transcode("ComponentDependency") );
   399 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentDependency( &XMLString::release, XMLString::transcode("ComponentDependency") );
       
   400 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfo( &XMLString::release, XMLString::transcode("ApplicationRegistrationInfo") );
   395 
   401 
   396 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails = GetComponentDetails(aDOMElement);
   402 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails = GetComponentDetails(aDOMElement);
   397 	component.iComponentDetails = componentDetails;
   403 	component.iComponentDetails = componentDetails;
   398 
   404 
   399 	// for each ComponentProperty retrieve all tags
   405 	// for each ComponentProperty retrieve all tags
   420 		else if( XMLString::equals(currentElement->getTagName(), tagComponentDependency.get()))
   426 		else if( XMLString::equals(currentElement->getTagName(), tagComponentDependency.get()))
   421 			{
   427 			{
   422 			XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency = GetComponentDependency(currentElement);
   428 			XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency = GetComponentDependency(currentElement);
   423 			component.iComponentDependency = componentDependency;
   429 			component.iComponentDependency = componentDependency;
   424 			}
   430 			}
   425 		}
   431 		else if( XMLString::equals(currentElement->getTagName(), tagApplicationRegistrationInfo.get()))
   426 
   432 			{
       
   433 			XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo = GetApplicationRegistrationInfo(currentElement);
       
   434 			component.iApplicationRegistrationInfo.push_back(appRegistrationInfo);
       
   435 			}
       
   436 		}
       
   437 	LOGEXIT("CScrXmlParser::GetPreProvisionData()");
   427 	return component;
   438 	return component;
   428 	}
   439 	}
   429 
   440 
   430 XmlDetails::TScrPreProvisionDetail::TComponentLocalizable CScrXmlParser::GetComponentLocalizable(const DOMElement* aDOMElement)
   441 XmlDetails::TScrPreProvisionDetail::TComponentLocalizable CScrXmlParser::GetComponentLocalizable(const DOMElement* aDOMElement)
   431 	{
   442 	{
       
   443 	LOGENTER("CScrXmlParser::GetComponentLocalizable()");
   432 	// tags in ComponentLocalizable
   444 	// tags in ComponentLocalizable
   433 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableLocale( &XMLString::release, XMLString::transcode("ComponentLocalizable_Locale") );
   445 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableLocale( &XMLString::release, XMLString::transcode("ComponentLocalizable_Locale") );
   434 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableName( &XMLString::release, XMLString::transcode("ComponentLocalizable_Name") );
   446 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableName( &XMLString::release, XMLString::transcode("ComponentLocalizable_Name") );
   435 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableVendor( &XMLString::release, XMLString::transcode("ComponentLocalizable_Vendor") );
   447 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentLocalizableVendor( &XMLString::release, XMLString::transcode("ComponentLocalizable_Vendor") );
   436 	
   448 	
   452 	if(vendor->getLength() != 0)
   464 	if(vendor->getLength() != 0)
   453 		{
   465 		{
   454 		const XMLCh* textVendor = vendor->item(0)->getTextContent();
   466 		const XMLCh* textVendor = vendor->item(0)->getTextContent();
   455 		componentLocalizable.iVendor = textVendor;
   467 		componentLocalizable.iVendor = textVendor;
   456 		}
   468 		}
   457 
   469 	LOGEXIT("CScrXmlParser::GetComponentLocalizable()");
   458 	return componentLocalizable;
   470 	return componentLocalizable;
   459 	
   471 	
   460 	}
   472 	}
   461 
   473 
   462 XmlDetails::TScrPreProvisionDetail::TComponentProperty CScrXmlParser::GetComponentProperty(const DOMElement* aEnvironment)
   474 XmlDetails::TScrPreProvisionDetail::TComponentProperty CScrXmlParser::GetComponentProperty(const DOMElement* aEnvironment)
   463 	{
   475 	{
       
   476 	LOGENTER("CScrXmlParser::GetComponentProperty()");
   464 	// tags in ComponentProperty
   477 	// tags in ComponentProperty
   465 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyName( &XMLString::release, XMLString::transcode("Name") );
   478 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyName( &XMLString::release, XMLString::transcode("Name") );
   466 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyLocale( &XMLString::release, XMLString::transcode("ComponentProperty_Locale") );
   479 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyLocale( &XMLString::release, XMLString::transcode("ComponentProperty_Locale") );
   467 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyValue( &XMLString::release, XMLString::transcode("ComponentProperty_Value") );
   480 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyValue( &XMLString::release, XMLString::transcode("ComponentProperty_Value") );
   468 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyIsBinary( &XMLString::release, XMLString::transcode("ComponentProperty_IsBinary") );
   481 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagComponentPropertyIsBinary( &XMLString::release, XMLString::transcode("ComponentProperty_IsBinary") );
   513 	if(isBinary->getLength() != 0)
   526 	if(isBinary->getLength() != 0)
   514 		{
   527 		{
   515 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
   528 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
   516 		componentProperty.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
   529 		componentProperty.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
   517 		}
   530 		}
   518 
   531 	LOGEXIT("CScrXmlParser::GetComponentProperty()");
   519 	return componentProperty;
   532 	return componentProperty;
   520 	
   533 	
   521 	}
   534 	}
   522 
   535 
   523 XmlDetails::TScrPreProvisionDetail::TComponentFile CScrXmlParser::GetComponentFile( const DOMElement* aDOMElement)
   536 XmlDetails::TScrPreProvisionDetail::TComponentFile CScrXmlParser::GetComponentFile( const DOMElement* aDOMElement)
   524 	{
   537 	{
       
   538 	LOGENTER("CScrXmlParser::GetComponentFile()");
   525 	XmlDetails::TScrPreProvisionDetail::TComponentFile componentFile;
   539 	XmlDetails::TScrPreProvisionDetail::TComponentFile componentFile;
   526 	
   540 	
   527 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileProperty( &XMLString::release, XMLString::transcode("FileProperty") );
   541 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileProperty( &XMLString::release, XMLString::transcode("FileProperty") );
   528 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocation( &XMLString::release, XMLString::transcode("Location") );	
   542 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagLocation( &XMLString::release, XMLString::transcode("Location") );	
   529 	
   543 	
   541 	
   555 	
   542 	// attribute - location
   556 	// attribute - location
   543 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   557 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   544 	DOMNode* location = attributes->getNamedItem(tagLocation.get());
   558 	DOMNode* location = attributes->getNamedItem(tagLocation.get());
   545 	componentFile.iLocation = location->getTextContent();
   559 	componentFile.iLocation = location->getTextContent();
   546 	
   560 	LOGEXIT("CScrXmlParser::GetComponentFile()");
   547 	return componentFile;
   561 	return componentFile;
   548 	}
   562 	}
   549 
   563 
   550 XmlDetails::TScrPreProvisionDetail::TComponentDependency CScrXmlParser::GetComponentDependency( const XERCES_CPP_NAMESPACE::DOMElement* aDOMElement)
   564 XmlDetails::TScrPreProvisionDetail::TComponentDependency CScrXmlParser::GetComponentDependency( const XERCES_CPP_NAMESPACE::DOMElement* aDOMElement)
   551 	{
   565 	{
       
   566 	LOGENTER("CScrXmlParser::GetComponentDependency()");
   552 	XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency;
   567 	XmlDetails::TScrPreProvisionDetail::TComponentDependency componentDependency;
   553 	
   568 	
   554 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDepList( &XMLString::release, XMLString::transcode("DependencyList") );
   569 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDepList( &XMLString::release, XMLString::transcode("DependencyList") );
   555 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDependentId( &XMLString::release, XMLString::transcode("DependentId") );	
   570 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDependentId( &XMLString::release, XMLString::transcode("DependentId") );	
   556 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSupplierId( &XMLString::release, XMLString::transcode("SupplierId") );	
   571 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSupplierId( &XMLString::release, XMLString::transcode("SupplierId") );	
   584 	
   599 	
   585 	// attribute - location
   600 	// attribute - location
   586 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   601 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   587 	DOMNode* dependentId = attributes->getNamedItem(tagDependentId.get());
   602 	DOMNode* dependentId = attributes->getNamedItem(tagDependentId.get());
   588 	componentDependency.iDependentId = dependentId->getTextContent();
   603 	componentDependency.iDependentId = dependentId->getTextContent();
   589 	
   604 	LOGEXIT("CScrXmlParser::GetComponentDependency()");
   590 	return componentDependency;
   605 	return componentDependency;
   591 	}
   606 	}
   592 
   607 
   593 XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty 
   608 XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty 
   594 	CScrXmlParser::GetFileProperty( const DOMElement* aDOMElement)
   609 	CScrXmlParser::GetFileProperty( const DOMElement* aDOMElement)
   595 	{
   610 	{
       
   611 	LOGENTER("CScrXmlParser::GetFileProperty()");
   596 	// tag for FileProperty
   612 	// tag for FileProperty
   597 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyName( &XMLString::release, XMLString::transcode("Name") );
   613 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyName( &XMLString::release, XMLString::transcode("Name") );
   598 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyValue( &XMLString::release, XMLString::transcode("FileProperty_Value") );
   614 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyValue( &XMLString::release, XMLString::transcode("FileProperty_Value") );
   599 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyIsBinary( &XMLString::release, XMLString::transcode("FileProperty_IsBinary") );
   615 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFilePropertyIsBinary( &XMLString::release, XMLString::transcode("FileProperty_IsBinary") );
   600 
   616 
   636 					fileProperty.iValue = currentElement->getTextContent();
   652 					fileProperty.iValue = currentElement->getTextContent();
   637 					}
   653 					}
   638 				}
   654 				}
   639 			}
   655 			}
   640 		}
   656 		}
       
   657 	LOGEXIT("CScrXmlParser::GetFileProperty()");
   641 	return fileProperty;
   658 	return fileProperty;
   642 	}
   659 	}
   643 		
   660 		
   644 XmlDetails::TScrPreProvisionDetail::TComponentDetails 
   661 XmlDetails::TScrPreProvisionDetail::TComponentDetails 
   645 	CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement)
   662 	CScrXmlParser::GetComponentDetails( const DOMElement* aDOMElement)
   646 	{
   663 	{
       
   664 	LOGENTER("CScrXmlParser::GetComponentDetails()");
   647 	// tags for ComponentDetails
   665 	// tags for ComponentDetails
       
   666 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRomApplication( &XMLString::release, XMLString::transcode("RomApplication") );
   648 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") );
   667 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagRemovable( &XMLString::release, XMLString::transcode("Removable") );
   649 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") );
   668 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSize( &XMLString::release, XMLString::transcode("Size") );
   650 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") );
   669 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagScomoState( &XMLString::release, XMLString::transcode("ScomoState") );
   651 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") );
   670 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagGlobalId( &XMLString::release, XMLString::transcode("GlobalId") );
   652 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") );
   671 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagVersion( &XMLString::release, XMLString::transcode("Version") );
   653 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") );
   672 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOriginVerified( &XMLString::release, XMLString::transcode("OriginVerified") );
   654 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") );
   673 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagHidden( &XMLString::release, XMLString::transcode("Hidden") );
   655 	
   674 	
   656 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails;
   675 	XmlDetails::TScrPreProvisionDetail::TComponentDetails componentDetails;
   657 	
   676 	
       
   677 	DOMNodeList* romApplication	= aDOMElement->getElementsByTagName(tagRomApplication.get());
   658 	DOMNodeList* removable	= aDOMElement->getElementsByTagName(tagRemovable.get());
   678 	DOMNodeList* removable	= aDOMElement->getElementsByTagName(tagRemovable.get());
   659 	DOMNodeList* size		= aDOMElement->getElementsByTagName(tagSize.get());
   679 	DOMNodeList* size		= aDOMElement->getElementsByTagName(tagSize.get());
   660 	DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get());
   680 	DOMNodeList* scomoState = aDOMElement->getElementsByTagName(tagScomoState.get());
   661 	DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get());
   681 	DOMNodeList* globalId = aDOMElement->getElementsByTagName(tagGlobalId.get());
   662 	DOMNodeList* versionDetail	= aDOMElement->getElementsByTagName(tagVersion.get());
   682 	DOMNodeList* versionDetail	= aDOMElement->getElementsByTagName(tagVersion.get());
   663 	DOMNodeList* originVerified	= aDOMElement->getElementsByTagName(tagOriginVerified.get());
   683 	DOMNodeList* originVerified	= aDOMElement->getElementsByTagName(tagOriginVerified.get());
   664 	DOMNodeList* hidden	= aDOMElement->getElementsByTagName(tagHidden.get());
   684 	DOMNodeList* hidden	= aDOMElement->getElementsByTagName(tagHidden.get());
   665 	
   685 	
       
   686 	if( romApplication->getLength() != 0)
       
   687 		{
       
   688 		LOGINFO("CScrXmlParser::GetComponentDetails()- rom app");
       
   689 		const XMLCh* textRomApplication = romApplication->item(0)->getTextContent();
       
   690 		componentDetails.iIsRomApplication = Util::WideCharToInteger(textRomApplication);
       
   691 		}
       
   692 
   666 	if( removable->getLength() != 0)
   693 	if( removable->getLength() != 0)
   667 		{
   694 		{
   668 		const XMLCh* textRemovable = removable->item(0)->getTextContent();
   695 		const XMLCh* textRemovable = removable->item(0)->getTextContent();
   669 		componentDetails.iIsRemovable = Util::WideCharToInteger(textRemovable);
   696 		componentDetails.iIsRemovable = Util::WideCharToInteger(textRemovable);
   670 		}
   697 		}
   714 	if( hidden->getLength() != 0)
   741 	if( hidden->getLength() != 0)
   715 		{
   742 		{
   716 		const XMLCh* textHidden = hidden->item(0)->getTextContent();
   743 		const XMLCh* textHidden = hidden->item(0)->getTextContent();
   717 		componentDetails.iIsHidden = Util::WideCharToInteger(textHidden);
   744 		componentDetails.iIsHidden = Util::WideCharToInteger(textHidden);
   718 		}
   745 		}
   719 	
   746 	LOGEXIT("CScrXmlParser::GetComponentDetails()");
   720 	return componentDetails;
   747 	return componentDetails;
   721 	}
   748 	}
   722 
   749 
   723 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName 
   750 XmlDetails::TScrEnvironmentDetails::TLocalizedSoftwareTypeName 
   724 	CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement)
   751 	CScrXmlParser::GetLocalizedSoftwareTypeName(const DOMElement* aDOMElement)
   725 	{
   752 	{
       
   753 	LOGENTER("CScrXmlParser::GetLocalizedSoftwareTypeName()");
   726 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") );
   754 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameLocale( &XMLString::release, XMLString::transcode("Locale") );
   727 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") );
   755 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSwTypeNameValue( &XMLString::release, XMLString::transcode("Value") );
   728 	
   756 	
   729 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   757 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
   730 	DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get());
   758 	DOMNode* locale = attributes->getNamedItem(tagSwTypeNameLocale.get());
   735 	const XMLCh* textLocale = locale->getTextContent();
   763 	const XMLCh* textLocale = locale->getTextContent();
   736 	localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale);
   764 	localizedSwTypeName.iLocale = Util::WideCharToInteger(textLocale);
   737 	
   765 	
   738 	const XMLCh* textName = name->getTextContent();
   766 	const XMLCh* textName = name->getTextContent();
   739 	localizedSwTypeName.iName = textName;
   767 	localizedSwTypeName.iName = textName;
   740 
   768 	LOGEXIT("CScrXmlParser::GetLocalizedSoftwareTypeName()");
   741 	return localizedSwTypeName;
   769 	return localizedSwTypeName;
       
   770 	}
       
   771 
       
   772 XmlDetails::TScrEnvironmentDetails::TCustomAcessList 
       
   773 	CScrXmlParser::GetCustomAcessList(const DOMElement* aDOMElement)
       
   774 	{
       
   775 	LOGENTER("CScrXmlParser::GetCustomAcessList()");
       
   776 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagSecureId( &XMLString::release, XMLString::transcode("SecureId") );
       
   777 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAccessMode( &XMLString::release, XMLString::transcode("AccessMode") );
       
   778 	
       
   779 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
   780 	DOMNode* secureId = attributes->getNamedItem(tagSecureId.get());
       
   781 	DOMNode* accessMode = attributes->getNamedItem(tagAccessMode.get());
       
   782 	
       
   783 	XmlDetails::TScrEnvironmentDetails::TCustomAcessList customAcessList;
       
   784 
       
   785 	fn_auto_ptr<releaseChPtr,char> textSecureId(&XMLString::release, XMLString::transcode(secureId->getTextContent()));
       
   786 	int secureIdVal=0;	
       
   787 	sscanf(textSecureId.get(),"%x",&secureIdVal);
       
   788 	customAcessList.iSecureId = secureIdVal;
       
   789 	
       
   790 	const XMLCh* textAccessMode = accessMode->getTextContent();
       
   791 	customAcessList.iAccessMode = Util::WideCharToInteger(textAccessMode);
       
   792 	LOGEXIT("CScrXmlParser::GetCustomAcessList()");
       
   793 	return customAcessList;
       
   794 	}
       
   795 
       
   796 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo CScrXmlParser::GetApplicationRegistrationInfo(const DOMElement* aDOMElement)
       
   797 	{
       
   798 	LOGENTER("CScrXmlParser::GetApplicationRegistrationInfo()");
       
   799 	// tags in ApplicationRegistrationInfo
       
   800 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppAttribute( &XMLString::release, XMLString::transcode("ApplicationAttribute") );
       
   801 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoOpaqueData ( &XMLString::release, XMLString::transcode("OpaqueData") );
       
   802 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoFileOwnershipInfo( &XMLString::release, XMLString::transcode("FileOwnershipinfo") );
       
   803 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
       
   804 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppServiceInfo( &XMLString::release, XMLString::transcode("ApplicationServiceInfo") );
       
   805 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppLocalizableInfo( &XMLString::release, XMLString::transcode("ApplicationLocalizableInfo") );
       
   806 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationRegistrationInfoAppProperty( &XMLString::release, XMLString::transcode("ApplicationProperty") );
       
   807 
       
   808 	DOMNodeList* appAttributes = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppAttribute.get());
       
   809 	const XMLSize_t appAttributeCount = appAttributes->getLength();
       
   810 	DOMNodeList* OpaqueData	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoOpaqueData.get());
       
   811 	const XMLSize_t OpaqueDataCount = OpaqueData->getLength();
       
   812 	DOMNodeList* fileOwnershipInfos	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoFileOwnershipInfo.get());
       
   813 	const XMLSize_t fileOwnershipInfoCount = fileOwnershipInfos->getLength();
       
   814 	DOMNodeList* appServiceInfos = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppServiceInfo.get());
       
   815 	const XMLSize_t appServiceInfoCount = appServiceInfos->getLength();
       
   816 	DOMNodeList* appLocalizableInfos	= aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppLocalizableInfo.get());
       
   817 	const XMLSize_t appLocalizableInfoCount = appLocalizableInfos->getLength();
       
   818 	DOMNodeList* appProperties = aDOMElement->getElementsByTagName(tagApplicationRegistrationInfoAppProperty.get());
       
   819 	const XMLSize_t appPropertyCount = appProperties->getLength();
       
   820 
       
   821 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo appRegistrationInfo;
       
   822 
       
   823 	// for each AppAttribute retrieve all tags
       
   824 	for( XMLSize_t index = 0; index < appAttributeCount; ++index )
       
   825 		{
       
   826 		DOMElement* currentappAttribute = static_cast< xercesc::DOMElement* >( appAttributes->item(index) );
       
   827 		
       
   828 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute = GetAppAttribute(currentappAttribute);
       
   829 		appRegistrationInfo.iApplicationAttribute.push_back(appAttribute);
       
   830 		}
       
   831 
       
   832 	// for each OpaqueData retrieve all tags
       
   833 	for( XMLSize_t index = 0; index < OpaqueDataCount; ++index )
       
   834 		{
       
   835 		DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( OpaqueData->item(index) );
       
   836 		
       
   837 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
   838 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetOpaqueDataType(currentOpaqueData);
       
   839 
       
   840 		appProperty.iLocale = opaqueDataType.iLocale;
       
   841 		appProperty.iName = L"OpaqueData";
       
   842 		appProperty.iIntValue = 0;
       
   843 		appProperty.iIsStr8Bit = true;
       
   844 		appProperty.iServiceUid = 0;
       
   845 		appProperty.iStrValue = opaqueDataType.iOpaqueData;
       
   846 		
       
   847 		appRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
   848 		}
       
   849 
       
   850 	// for each FileOwnershipInfo retrieve all tags
       
   851 	for( XMLSize_t index = 0; index < fileOwnershipInfoCount; ++index )
       
   852 		{
       
   853 		DOMElement* currentFileOwnershipInfo = static_cast< xercesc::DOMElement* >( fileOwnershipInfos->item(index) );
       
   854 
       
   855 		std::wstring file = GetFileOwnershipInfo(currentFileOwnershipInfo);
       
   856 
       
   857 		appRegistrationInfo.iFileOwnershipInfo.push_back(file);
       
   858 		}
       
   859 
       
   860 	// for each appServiceInfo retrieve all tags
       
   861 	for( XMLSize_t index = 0; index < appServiceInfoCount; ++index )
       
   862 		{
       
   863 		DOMElement* currentappServiceInfo = static_cast< xercesc::DOMElement* >( appServiceInfos->item(index) );
       
   864 		
       
   865 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo = GetAppServiceInfo(currentappServiceInfo, appRegistrationInfo);
       
   866 		appRegistrationInfo.iApplicationServiceInfo.push_back(appServiceInfo);
       
   867 		}
       
   868 
       
   869 	// for each appLocalizableInfo retrieve all tags
       
   870 	for( XMLSize_t index = 0; index < appLocalizableInfoCount; ++index )
       
   871 		{
       
   872 		DOMElement* currentAppLocalizableInfo = static_cast< xercesc::DOMElement* >( appLocalizableInfos->item(index) );
       
   873 		
       
   874 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo = GetAppLocalizableInfo(currentAppLocalizableInfo);
       
   875 		appRegistrationInfo.iApplicationLocalizableInfo.push_back(appLocalizableInfo);
       
   876 		}
       
   877 
       
   878 	// for each AppProperty retrieve all tags
       
   879 	for( XMLSize_t index = 0; index < appPropertyCount; ++index )
       
   880 		{
       
   881 		DOMElement* currentAppProperty = static_cast< xercesc::DOMElement* >( appProperties->item(index) );
       
   882 		
       
   883 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty = GetAppProperty(currentAppProperty);
       
   884 		appRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
   885 		}
       
   886 	LOGEXIT("CScrXmlParser::GetApplicationRegistrationInfo()");
       
   887 	return appRegistrationInfo;
       
   888 	}
       
   889 
       
   890 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute 
       
   891 	CScrXmlParser::GetAppAttribute( const DOMElement* aDOMElement)
       
   892 	{
       
   893 	LOGENTER("CScrXmlParser::GetAppAttribute()");
       
   894 	// tags in AppAttribute
       
   895 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeName( &XMLString::release, XMLString::transcode("Name") );
       
   896 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_Value") );
       
   897 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppAttributeIsBinary( &XMLString::release, XMLString::transcode("ApplicationAttribute_IsBinary") );
       
   898 		
       
   899 	// tags of ComponentProperty_Value
       
   900 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeIntValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_IntValue") );
       
   901 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagApplicationAttributeStrValue( &XMLString::release, XMLString::transcode("ApplicationAttribute_StrValue") );
       
   902 	
       
   903 	// attribute - name
       
   904 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
   905 	DOMNode* name = attributes->getNamedItem(tagAppAttributeName.get());
       
   906 		
       
   907 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppAttributeValue.get());
       
   908 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppAttributeIsBinary.get());
       
   909 	
       
   910 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute appAttribute;
       
   911 	
       
   912 	const XMLCh* textName = name->getTextContent();
       
   913 	appAttribute.iName	= textName;
       
   914 	
       
   915 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
   916 	const XMLSize_t nodeCount = childNodes->getLength();
       
   917 
       
   918 	for(int index = 0; index< nodeCount; ++index)
       
   919 		{
       
   920 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
       
   921 		if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeIntValue.get()))
       
   922 			{
       
   923 			appAttribute.iIsIntValue = true;
       
   924 			appAttribute.iValue = currentElement->getTextContent();
       
   925 			break;
       
   926 			}
       
   927 		else if( XMLString::equals(currentElement->getTagName(), tagApplicationAttributeStrValue.get()))
       
   928 			{
       
   929 			appAttribute.iIsIntValue = false;
       
   930 			appAttribute.iValue = currentElement->getTextContent();
       
   931 			break;
       
   932 			}
       
   933 		}
       
   934 		
       
   935 	if(isBinary->getLength() != 0)
       
   936 		{
       
   937 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
   938 		appAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
       
   939 		}
       
   940 	LOGEXIT("CScrXmlParser::GetAppAttribute()");
       
   941 	return appAttribute;
       
   942 	}
       
   943 
       
   944 std::wstring CScrXmlParser::GetFileOwnershipInfo( const DOMElement* aDOMElement)
       
   945 	{
       
   946 	LOGENTER("CScrXmlParser::GetFileOwnershipInfo()");
       
   947 	// tags in FileOwnershipInfo 
       
   948 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagFileName( &XMLString::release, XMLString::transcode("FileName") );
       
   949 
       
   950 	DOMNodeList* fileName = aDOMElement->getElementsByTagName(tagFileName.get());
       
   951 	
       
   952 	std::wstring file;
       
   953 
       
   954 	if( fileName->getLength() != 0)
       
   955 		{
       
   956 		const XMLCh* fil = fileName->item(0)->getTextContent();
       
   957 		file = fil;
       
   958 		}
       
   959 
       
   960 	LOGEXIT("CScrXmlParser::GetFileOwnershipInfo()");
       
   961 	return file;
       
   962 	}
       
   963 
       
   964 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType 
       
   965 	CScrXmlParser::GetDataType( const DOMElement* aDOMElement)
       
   966 	{
       
   967 	LOGENTER("CScrXmlParser::GetDataType()");
       
   968 	// tags in DataType 
       
   969 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataTypePriority( &XMLString::release, XMLString::transcode("Priority") );
       
   970 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagDataType( &XMLString::release, XMLString::transcode("Type") );
       
   971 
       
   972 	DOMNodeList* priority = aDOMElement->getElementsByTagName(tagDataTypePriority.get());
       
   973 	DOMNodeList* type = aDOMElement->getElementsByTagName(tagDataType.get());
       
   974 	
       
   975 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType;
       
   976 
       
   977 	if( priority->getLength() != 0)
       
   978 		{
       
   979 		const XMLCh* pri = priority->item(0)->getTextContent();
       
   980 		dataType.iPriority = Util::WideCharToInteger(pri);
       
   981 		}
       
   982 
       
   983 	if( type->getLength() != 0)
       
   984 		{
       
   985 		const XMLCh* typ = type->item(0)->getTextContent();
       
   986 		dataType.iType = typ;
       
   987 		}
       
   988 	LOGEXIT("CScrXmlParser::GetDataType()");
       
   989 	return dataType;
       
   990 	}
       
   991 
       
   992 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType 
       
   993 	CScrXmlParser::GetOpaqueDataType( const DOMElement* aDOMElement)
       
   994 	{
       
   995 	LOGENTER("CScrXmlParser::GetOpaqueDataType()");
       
   996 	// tags in OpaqueDataType 
       
   997 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagData( &XMLString::release, XMLString::transcode("Data") );
       
   998 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagOpaqueLocale( &XMLString::release, XMLString::transcode("OpaqueLocale") );
       
   999 
       
  1000 	DOMNodeList* Data = aDOMElement->getElementsByTagName(tagData.get());
       
  1001 	DOMNodeList* OpaqueLocale = aDOMElement->getElementsByTagName(tagOpaqueLocale.get());
       
  1002 	
       
  1003 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
       
  1004 
       
  1005 	if( OpaqueLocale->getLength() != 0)
       
  1006 		{
       
  1007 		const XMLCh* pri = OpaqueLocale->item(0)->getTextContent();
       
  1008 		opaqueDataType.iLocale = Util::WideCharToInteger(pri);
       
  1009 		}
       
  1010 
       
  1011 	if( Data->getLength() != 0)
       
  1012 		{
       
  1013 		const XMLCh* typ = Data->item(0)->getTextContent();
       
  1014 		opaqueDataType.iOpaqueData = typ;
       
  1015 		}
       
  1016 	LOGEXIT("CScrXmlParser::GetOpaqueDataType()");
       
  1017 	return opaqueDataType;
       
  1018 	}
       
  1019 
       
  1020 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType 
       
  1021 	CScrXmlParser::GetServiceOpaqueDataType( const DOMElement* aDOMElement)
       
  1022 	{
       
  1023 	LOGENTER("CScrXmlParser::GetServiceOpaqueDataType()");
       
  1024 	// tags in OpaqueDataType 
       
  1025 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceData( &XMLString::release, XMLString::transcode("ServiceData") );
       
  1026 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagServiceOpaqueLocale( &XMLString::release, XMLString::transcode("ServiceOpaqueLocale") );
       
  1027 
       
  1028 	DOMNodeList* ServiceData = aDOMElement->getElementsByTagName(tagServiceData.get());
       
  1029 	DOMNodeList* ServiceOpaqueLocale = aDOMElement->getElementsByTagName(tagServiceOpaqueLocale.get());
       
  1030 	
       
  1031 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType;
       
  1032 
       
  1033 	if( ServiceOpaqueLocale->getLength() != 0)
       
  1034 		{
       
  1035 		const XMLCh* pri = ServiceOpaqueLocale->item(0)->getTextContent();
       
  1036 		opaqueDataType.iLocale = Util::WideCharToInteger(pri);
       
  1037 		}
       
  1038 
       
  1039 	if( ServiceData->getLength() != 0)
       
  1040 		{
       
  1041 		const XMLCh* typ = ServiceData->item(0)->getTextContent();
       
  1042 		opaqueDataType.iOpaqueData = typ;
       
  1043 		}
       
  1044 	LOGEXIT("CScrXmlParser::GetServiceOpaqueDataType()");
       
  1045 	return opaqueDataType;
       
  1046 	}
       
  1047 
       
  1048 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo 
       
  1049 	CScrXmlParser::GetAppServiceInfo( const DOMElement* aDOMElement, XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo& aAppRegistrationInfo )
       
  1050 	{
       
  1051 	LOGENTER("CScrXmlParser::GetAppServiceInfo()");
       
  1052 	// tags in AppServiceInfo
       
  1053 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoUid( &XMLString::release, XMLString::transcode("Uid") );
       
  1054 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceAppProperty( &XMLString::release, XMLString::transcode("ServiceOpaqueData") );
       
  1055 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppServiceInfoDataType( &XMLString::release, XMLString::transcode("ApplicationDataType") );
       
  1056 
       
  1057 	DOMNodeList* uid = aDOMElement->getElementsByTagName(tagAppServiceInfoUid.get());
       
  1058 
       
  1059 	DOMNodeList* ServiceOpaqueData = aDOMElement->getElementsByTagName(tagAppServiceAppProperty.get());
       
  1060 	const XMLSize_t ServiceOpaqueDataCount = ServiceOpaqueData->getLength();
       
  1061 	
       
  1062 	DOMNodeList* dataTypes = aDOMElement->getElementsByTagName(tagAppServiceInfoDataType.get());
       
  1063 	const XMLSize_t dataTypeCount = dataTypes->getLength();
       
  1064 
       
  1065 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo appServiceInfo;
       
  1066 
       
  1067 	if( uid->getLength() != 0)
       
  1068 		{
       
  1069 		const XMLCh* priority = uid->item(0)->getTextContent();
       
  1070 		appServiceInfo.iUid = Util::WideCharToInteger(priority);
       
  1071 		}
       
  1072 
       
  1073 	// for each OpaqueData retrieve all tags
       
  1074 	for( XMLSize_t index = 0; index < ServiceOpaqueDataCount; ++index )
       
  1075 		{
       
  1076 		DOMElement* currentOpaqueData = static_cast< xercesc::DOMElement* >( ServiceOpaqueData->item(index) );
       
  1077 		
       
  1078 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
  1079 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType opaqueDataType = GetServiceOpaqueDataType(currentOpaqueData);
       
  1080 
       
  1081 		appProperty.iLocale = opaqueDataType.iLocale;
       
  1082 		appProperty.iName = L"OpaqueData";
       
  1083 		appProperty.iIntValue = 0;
       
  1084 		appProperty.iIsStr8Bit = true;
       
  1085 		appProperty.iServiceUid = appServiceInfo.iUid;
       
  1086 		appProperty.iStrValue = opaqueDataType.iOpaqueData;
       
  1087 		
       
  1088 		aAppRegistrationInfo.iApplicationProperty.push_back(appProperty);
       
  1089 		}
       
  1090 
       
  1091 	// for each DataType retrieve all tags
       
  1092 	for( XMLSize_t index = 0; index < dataTypeCount; ++index )
       
  1093 		{
       
  1094 		DOMElement* currentDataType = static_cast< xercesc::DOMElement* >( dataTypes->item(index) );
       
  1095 		
       
  1096 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType dataType = GetDataType(currentDataType);
       
  1097 		appServiceInfo.iDataType.push_back(dataType);
       
  1098 		}
       
  1099 	LOGEXIT("CScrXmlParser::GetAppServiceInfo()");
       
  1100 	return appServiceInfo;
       
  1101 
       
  1102 	}
       
  1103 
       
  1104 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo 
       
  1105 	CScrXmlParser::GetAppLocalizableInfo( const DOMElement* aDOMElement)
       
  1106 	{
       
  1107 	LOGENTER("CScrXmlParser::GetAppLocalizableInfo()");
       
  1108 	// tags in AppLocalizableInfo  
       
  1109 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttribute( &XMLString::release, XMLString::transcode("LocalizableAttribute") );
       
  1110 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewData ( &XMLString::release, XMLString::transcode("ViewData") );
       
  1111 	
       
  1112 	DOMNodeList* localizableAttributes = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttribute.get());
       
  1113 	const XMLSize_t attributeCount = localizableAttributes->getLength();
       
  1114 	DOMNodeList* viewData = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewData.get());
       
  1115 	const XMLSize_t viewDataCount = viewData->getLength();
       
  1116 
       
  1117 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo appLocalizableInfo;
       
  1118 
       
  1119 	LOGINFO("for each AppLocalizableInfoAttribute retrieve all tags");
       
  1120 	// for each AppLocalizableInfoAttribute retrieve all tags
       
  1121 	for( XMLSize_t index = 0; index < attributeCount; ++index )
       
  1122 		{
       
  1123 		DOMElement* currentLocalizableAttribute = static_cast< xercesc::DOMElement* >( localizableAttributes->item(index) );
       
  1124 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute = GetAppLocalizableAttribute(currentLocalizableAttribute);
       
  1125 		appLocalizableInfo.iLocalizableAttribute.push_back(appLocalizableAttribute);
       
  1126 		}
       
  1127 
       
  1128 	LOGINFO("for each AppLocalizableViewData retrieve all tags");
       
  1129 	// for each AppLocalizableViewData retrieve all tags
       
  1130 	
       
  1131 	for( XMLSize_t index = 0; index < viewDataCount; ++index )
       
  1132 		{
       
  1133 		DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewData->item(index) );
       
  1134 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appLocalizableViewData = GetAppLocalizableViewData(currentLocalizableViewData);
       
  1135 		LOGINFO("push_back viewdata");
       
  1136 		appLocalizableInfo.iViewData.push_back(appLocalizableViewData);
       
  1137 		}
       
  1138 
       
  1139 	LOGEXIT("CScrXmlParser::GetAppLocalizableInfo()");
       
  1140 	return appLocalizableInfo;
       
  1141 	}
       
  1142 
       
  1143 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute 
       
  1144 	CScrXmlParser::GetAppLocalizableAttribute( const DOMElement* aDOMElement)
       
  1145 	{
       
  1146 	LOGENTER("CScrXmlParser::GetAppLocalizableAttribute()");
       
  1147 	// tags in AppLocalizableInfo  
       
  1148 	// tags in AppLocalizableInfoAttribute
       
  1149 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeName( &XMLString::release, XMLString::transcode("Name") );
       
  1150 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_Value") );
       
  1151 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIsBinary( &XMLString::release, XMLString::transcode("LocalizableAttribute_IsBinary") );
       
  1152 		
       
  1153 	// tags of AppLocalizableInfoAttribute_Value
       
  1154 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeIntValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_IntValue") );
       
  1155 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoAttributeStrValue( &XMLString::release, XMLString::transcode("LocalizableAttribute_StrValue") );
       
  1156 	
       
  1157 	LOGINFO("attribute - name");
       
  1158 	// attribute - name
       
  1159 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
  1160 	DOMNode* name = attributes->getNamedItem(tagAppLocalizableInfoAttributeName.get());
       
  1161 		
       
  1162 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeValue.get());
       
  1163 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableInfoAttributeIsBinary.get());
       
  1164 	
       
  1165 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute appLocalizableAttribute;
       
  1166 	
       
  1167 	LOGINFO("name->getTextContent");
       
  1168 	const XMLCh* textName = name->getTextContent();
       
  1169 	appLocalizableAttribute.iName = textName;
       
  1170 	
       
  1171 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
  1172 	const XMLSize_t nodeCount = childNodes->getLength();
       
  1173 
       
  1174 	for(int index = 0; index< nodeCount; ++index)
       
  1175 		{
       
  1176 		DOMElement* currentElement = static_cast< xercesc::DOMElement* >( childNodes->item(index) );
       
  1177 		if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeIntValue.get()))
       
  1178 			{
       
  1179 			appLocalizableAttribute.iIsIntValue = true;
       
  1180 			appLocalizableAttribute.iValue = currentElement->getTextContent();
       
  1181 			break;
       
  1182 			}
       
  1183 		else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableInfoAttributeStrValue.get()))
       
  1184 			{
       
  1185 			appLocalizableAttribute.iIsIntValue = false;
       
  1186 			appLocalizableAttribute.iValue = currentElement->getTextContent();
       
  1187 			break;
       
  1188 			}
       
  1189 		}
       
  1190 		
       
  1191 	if(isBinary->getLength() != 0)
       
  1192 		{
       
  1193 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1194 		appLocalizableAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
       
  1195 		}
       
  1196 
       
  1197 	LOGEXIT("CScrXmlParser::GetAppLocalizableAttribute()");
       
  1198 	return appLocalizableAttribute;
       
  1199 	}
       
  1200 
       
  1201 
       
  1202 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData 
       
  1203 	CScrXmlParser::GetAppLocalizableViewData( const DOMElement* aDOMElement)
       
  1204 	{
       
  1205 	LOGENTER("CScrXmlParser::GetAppLocalizableViewData()");
       
  1206 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableInfoViewDataAttribute ( &XMLString::release, XMLString::transcode("ViewDataAttribute") );
       
  1207 
       
  1208 	DOMNodeList* viewDataAttr = aDOMElement->getElementsByTagName(tagAppLocalizableInfoViewDataAttribute.get());
       
  1209 	const XMLSize_t viewDataAttrCount = viewDataAttr->getLength();
       
  1210 	
       
  1211 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData appViewData;
       
  1212 
       
  1213 	for( XMLSize_t index = 0; index < viewDataAttrCount; ++index )
       
  1214 	{
       
  1215 		DOMElement* currentLocalizableViewData = static_cast< xercesc::DOMElement* >( viewDataAttr->item(index) );
       
  1216 		XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewData = GetAppLocalizableViewDataAttributes(currentLocalizableViewData);
       
  1217 		LOGINFO("push_back viewdata");
       
  1218 		appViewData.iViewDataAttributes.push_back(appLocalizableViewData);
       
  1219 	}
       
  1220 	LOGEXIT("CScrXmlParser::GetAppLocalizableViewData()");
       
  1221 	return appViewData;
       
  1222 	}
       
  1223 
       
  1224 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes 
       
  1225 	CScrXmlParser::GetAppLocalizableViewDataAttributes( const DOMElement* aDOMElement)
       
  1226 	{
       
  1227 	LOGENTER("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
       
  1228 	// tags in AppLocalizableViewData
       
  1229 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataName( &XMLString::release, XMLString::transcode("Name") );
       
  1230 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataValue( &XMLString::release, XMLString::transcode("ViewData_Value") );
       
  1231 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIsBinary( &XMLString::release, XMLString::transcode("ViewData_IsBinary") );
       
  1232 		
       
  1233 	// tags of AppLocalizableViewData_Value
       
  1234 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataIntValue( &XMLString::release, XMLString::transcode("ViewData_IntValue") );
       
  1235 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppLocalizableViewDataStrValue( &XMLString::release, XMLString::transcode("ViewData_StrValue") );
       
  1236 		
       
  1237 	LOGINFO("attribute - name");
       
  1238 	// attribute - name
       
  1239 	DOMNamedNodeMap* attributes = aDOMElement->getAttributes();
       
  1240 	DOMNode* name = attributes->getNamedItem(tagAppLocalizableViewDataName.get());
       
  1241 		
       
  1242 	DOMNodeList* value = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataValue.get());
       
  1243 	DOMNodeList* isBinary = aDOMElement->getElementsByTagName(tagAppLocalizableViewDataIsBinary.get());
       
  1244 	
       
  1245 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes appLocalizableViewDataAttribute;
       
  1246 	
       
  1247 	LOGINFO("name->getTextContent");
       
  1248 	const XMLCh* textName = name->getTextContent();
       
  1249 	LOGINFO("assign name");
       
  1250 	appLocalizableViewDataAttribute.iName = textName;
       
  1251 
       
  1252 	LOGINFO("getChildNodes()");
       
  1253 	DOMNodeList* childNodes = value->item(0)->getChildNodes();
       
  1254 	LOGINFO("childNodes->getLength()");
       
  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(), tagAppLocalizableViewDataIntValue.get()))
       
  1261 			{
       
  1262 			LOGINFO("int value");
       
  1263 			appLocalizableViewDataAttribute.iIsIntValue = true;
       
  1264 			appLocalizableViewDataAttribute.iValue = currentElement->getTextContent();
       
  1265 			break;
       
  1266 			}
       
  1267 		else if( XMLString::equals(currentElement->getTagName(), tagAppLocalizableViewDataStrValue.get()))
       
  1268 			{
       
  1269 			LOGINFO("str value");
       
  1270 			appLocalizableViewDataAttribute.iIsIntValue = false;
       
  1271 			appLocalizableViewDataAttribute.iValue = currentElement->getTextContent();
       
  1272 			break;
       
  1273 			}
       
  1274 		}
       
  1275 		
       
  1276 	if(isBinary->getLength() != 0)
       
  1277 		{
       
  1278 		LOGINFO("bin value");
       
  1279 		const XMLCh* textIsBinary = isBinary->item(0)->getTextContent();
       
  1280 		appLocalizableViewDataAttribute.iIsStr8Bit = Util::WideCharToInteger(textIsBinary);		
       
  1281 		}
       
  1282 	LOGEXIT("CScrXmlParser::GetAppLocalizableViewDataAttributes()");
       
  1283 	return appLocalizableViewDataAttribute;
       
  1284 	}
       
  1285 
       
  1286 
       
  1287 XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty 
       
  1288 	CScrXmlParser::GetAppProperty( const DOMElement* aDOMElement)
       
  1289 	{
       
  1290 	LOGENTER("CScrXmlParser::GetAppProperty()");
       
  1291 	// tags in AppProperty
       
  1292 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyLocale( &XMLString::release, XMLString::transcode("Locale") );
       
  1293 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyName( &XMLString::release, XMLString::transcode("Name") );
       
  1294 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyIntValue( &XMLString::release, XMLString::transcode("IntValue") );
       
  1295 	fn_auto_ptr<releaseXmlChPtr, XMLCh> tagAppPropertyStrValue( &XMLString::release, XMLString::transcode("StrValue") );
       
  1296 
       
  1297 	DOMNodeList* locale = aDOMElement->getElementsByTagName(tagAppPropertyLocale.get());
       
  1298 	DOMNodeList* name = aDOMElement->getElementsByTagName(tagAppPropertyName.get());
       
  1299 	DOMNodeList* intvalue = aDOMElement->getElementsByTagName(tagAppPropertyIntValue.get());
       
  1300 	DOMNodeList* strvalue = aDOMElement->getElementsByTagName(tagAppPropertyStrValue.get());
       
  1301 	
       
  1302 	XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty appProperty;
       
  1303 
       
  1304 	if( locale->getLength() != 0)
       
  1305 		{
       
  1306 		const XMLCh* loc = locale->item(0)->getTextContent();
       
  1307 		appProperty.iLocale = Util::WideCharToInteger(loc);
       
  1308 		}
       
  1309 
       
  1310 	if( name->getLength() != 0)
       
  1311 		{
       
  1312 		const XMLCh* nam = name->item(0)->getTextContent();
       
  1313 		appProperty.iName = nam;
       
  1314 		}
       
  1315 	
       
  1316 	if( intvalue->getLength() != 0)
       
  1317 		{
       
  1318 		const XMLCh* intval = intvalue->item(0)->getTextContent();
       
  1319 		appProperty.iIntValue = Util::WideCharToInteger(intval);
       
  1320 		}
       
  1321 
       
  1322 	if( strvalue->getLength() != 0)
       
  1323 		{
       
  1324 		const XMLCh* strval = strvalue->item(0)->getTextContent();
       
  1325 		appProperty.iStrValue = strval;
       
  1326 		}
       
  1327 	LOGEXIT("CScrXmlParser::GetAppProperty()");
       
  1328 	return appProperty;
   742 	}
  1329 	}
   743 
  1330 
   744 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser)
  1331 void CScrXmlParser::ConfigDomParser(xercesc::XercesDOMParser& aDomParser)
   745 	{
  1332 	{
   746 	aDomParser.setValidationScheme( XercesDOMParser::Val_Always );
  1333 	aDomParser.setValidationScheme( XercesDOMParser::Val_Always );