axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: xml-axis/c/src/wsdd WSDDDocument.cpp
Date Fri, 12 Sep 2003 06:32:55 GMT
susantha    2003/09/11 23:32:55

  Modified:    c/src/wsdd WSDDDocument.cpp
  Log:
  performance related improvement in the parser
  
  Revision  Changes    Path
  1.16      +50 -39    xml-axis/c/src/wsdd/WSDDDocument.cpp
  
  Index: WSDDDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDDocument.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WSDDDocument.cpp	11 Sep 2003 12:24:47 -0000	1.15
  +++ WSDDDocument.cpp	12 Sep 2003 06:32:54 -0000	1.16
  @@ -111,7 +111,9 @@
   
   void  WSDDDocument::endElement (const XMLCh *const uri, const XMLCh *const localname, const
XMLCh *const qname)
   {
  -	if (!XMLString::equals(__XTRC(localname), kw_param)) //just neglect endElement of parameter
  +	AxisXMLString sLname = __XTRC(localname);
  +	const AxisXMLCh* lname = sLname.c_str();
  +	if (!XMLString::equals(lname, kw_param)) //just neglect endElement of parameter
   	{
   		if (m_lev1 == WSDD_UNKNOWN) //not inside a requestFlow or responseFlow elements
   		{
  @@ -124,7 +126,7 @@
   				m_lev0 = WSDD_DEPLOYMENT;
   				break;
   			case WSDD_SERVICE:
  -				if (XMLString::equals(__XTRC(localname), kw_srv))
  +				if (XMLString::equals(lname, kw_srv))
   				{
   					//add service object to Deployment object
   					m_pDeployment->AddService(m_pService);
  @@ -151,7 +153,7 @@
   		}
   		else // inside a requestFlow or responseFlow elements
   		{
  -			if(XMLString::equals(__XTRC(localname), kw_hdl))
  +			if(XMLString::equals(lname, kw_hdl))
   			{
   				m_lev2 = WSDD_UNKNOWN;
   				//add handler in m_pHandler to the corresponding container.
  @@ -178,11 +180,11 @@
   					default: ; //this cannot happen ?? 
   				}
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rqf))
  +			else if(XMLString::equals(lname, kw_rqf))
   			{  
   				m_lev1 = WSDD_UNKNOWN;
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rsf))
  +			else if(XMLString::equals(lname, kw_rsf))
   			{  
   				m_lev1 = WSDD_UNKNOWN;
   			}						
  @@ -192,20 +194,26 @@
   
   void WSDDDocument::ProcessAttributes(WSDDLevels ElementType, const Attributes &attrs)
   {
  +	AxisXMLString sLocal;
  +	AxisXMLString sValue;
  +	const AxisXMLCh* local;
  +	const AxisXMLCh* value;
   	for (int i = 0; i < attrs.getLength(); i++) 
   	{
  -		AxisXMLString local = __XTRC(attrs.getLocalName(i));
  -		AxisXMLString value = __XTRC(attrs.getValue(i));
  +		sLocal = __XTRC(attrs.getLocalName(i));
  +		sValue = __XTRC(attrs.getValue(i));
  +		local = sLocal.c_str();
  +		value = sValue.c_str();
   		switch(ElementType)
   		{
   		case WSDD_SERVICE: //add this attribute to current service object
  -			if (XMLString::equals(local.c_str(), kw_name))
  +			if (XMLString::equals(local, kw_name))
   			{
  -				m_pService->SetServiceName(value.c_str());
  +				m_pService->SetServiceName(value);
   			}
  -			else if (XMLString::equals(local.c_str(), kw_prv))
  +			else if (XMLString::equals(local, kw_prv))
   			{
  -				m_pService->SetProvider(value.c_str());
  +				m_pService->SetProvider(value);
   			}
   			else
   			{
  @@ -213,22 +221,22 @@
   			}
   			break;
   		case WSDD_HANDLER: //add this attribute to current handler object
  -			if (XMLString::equals(local.c_str(), kw_name))
  +			if (XMLString::equals(local, kw_name))
   			{
   				//usefull ? ignore for now .. //TODO
   			}
  -			else if (XMLString::equals(local.c_str(), kw_type))
  +			else if (XMLString::equals(local, kw_type))
   			{
   				//we get the libname for the hanlder here ???
  -				m_pHandler->SetLibName(value.c_str());
  -				if (m_pLibNameIdMap->find(value.c_str()) != m_pLibNameIdMap->end()) //libray
name already in the map
  +				m_pHandler->SetLibName(value);
  +				if (m_pLibNameIdMap->find(value) != m_pLibNameIdMap->end()) //libray name already
in the map
   				{
  -					m_pHandler->SetLibId((*m_pLibNameIdMap)[value.c_str()]);
  +					m_pHandler->SetLibId((*m_pLibNameIdMap)[value]);
   				}
   				else
   				{
  -					(*m_pLibNameIdMap)[value.c_str()] = ++m_nLibId;
  -					m_pHandler->SetLibId((*m_pLibNameIdMap)[value.c_str()]);
  +					(*m_pLibNameIdMap)[value] = ++m_nLibId;
  +					m_pHandler->SetLibId((*m_pLibNameIdMap)[value]);
   				}
   			}
   			else
  @@ -238,7 +246,7 @@
   			break;
   		case WSDD_REQFLOW:
   		case WSDD_RESFLOW:
  -			if (XMLString::equals(local.c_str(), kw_name))
  +			if (XMLString::equals(local, kw_name))
   			{
   				//usefull ? ignore for now .. //TODO
   			}
  @@ -248,12 +256,12 @@
   			}
   			break;
   		case WSDD_TRANSPORT:
  -			if (XMLString::equals(local.c_str(), kw_name))
  +			if (XMLString::equals(local, kw_name))
   			{
   				//get tranport type
  -				if (XMLString::equals(value.c_str(), kw_http))
  +				if (XMLString::equals(value, kw_http))
   					m_CurTrType = APTHTTP;
  -				else if (XMLString::equals(value.c_str(), kw_smtp))
  +				else if (XMLString::equals(value, kw_smtp))
   					m_CurTrType = APTSMTP;
   				else
   				{
  @@ -380,38 +388,41 @@
   
   void WSDDDocument::startElement(const XMLCh *const uri,	const XMLCh *const localname, const
XMLCh *const qname,	const Attributes &attrs)
   {
  +	AxisXMLString sLname = __XTRC(localname);
  +	const AxisXMLCh* lname = sLname.c_str();
  +
   	if (m_lev1 == WSDD_UNKNOWN) //not inside a requestFlow or responseFlow elements
   	{
   		switch(m_lev0)
   		{
   		case WSDD_UNKNOWN:
  -			if(XMLString::equals(__XTRC(localname), kw_depl))
  +			if(XMLString::equals(lname, kw_depl))
   			{  
   				m_lev0 = WSDD_DEPLOYMENT;
   				//nothing to get
   			}
   			break;
   		case WSDD_DEPLOYMENT:
  -			if(XMLString::equals(__XTRC(localname), kw_glconf))
  +			if(XMLString::equals(lname, kw_glconf))
   			{  
   				m_lev0 = WSDD_GLOBCONF;
   				//nothing to get
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_srv))
  +			else if(XMLString::equals(lname, kw_srv))
   			{  
   				m_lev0 = WSDD_SERVICE;
   				m_pService = new WSDDService();
   				//get service name and proider if any
   				ProcessAttributes(WSDD_SERVICE, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_hdl))
  +			else if(XMLString::equals(lname, kw_hdl))
   			{  
   				m_lev0 = WSDD_HANDLER;
   				m_pHandler = new WSDDHandler();
   				ProcessAttributes(WSDD_HANDLER, attrs);
   				//get handler name and type if any
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_tr))
  +			else if(XMLString::equals(lname, kw_tr))
   			{  
   				m_lev0 = WSDD_TRANSPORT;
   				ProcessAttributes(WSDD_TRANSPORT, attrs);
  @@ -422,16 +433,16 @@
   			}
   			break;
   		case WSDD_GLOBCONF:
  -			if(XMLString::equals(__XTRC(localname), kw_param))
  +			if(XMLString::equals(lname, kw_param))
   			{  
   				GetParameters(WSDD_GLOBCONF, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rqf))
  +			else if(XMLString::equals(lname, kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rsf))
  +			else if(XMLString::equals(lname, kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -442,16 +453,16 @@
   			}
   		break; 
   		case WSDD_SERVICE:
  -			if(XMLString::equals(__XTRC(localname), kw_param))
  +			if(XMLString::equals(lname, kw_param))
   			{  
   				GetParameters(WSDD_SERVICE, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rqf))
  +			else if(XMLString::equals(lname, kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rsf))
  +			else if(XMLString::equals(lname, kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -462,19 +473,19 @@
   			}
   		break;
   		case WSDD_HANDLER:
  -			if(XMLString::equals(__XTRC(localname), kw_param))
  +			if(XMLString::equals(lname, kw_param))
   			{  
   				GetParameters(WSDD_HANDLER, attrs);
   			}
   
   		break;
   		case WSDD_TRANSPORT:
  -			if(XMLString::equals(__XTRC(localname), kw_rqf))
  +			if(XMLString::equals(lname, kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(__XTRC(localname), kw_rsf))
  +			else if(XMLString::equals(lname, kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -484,19 +495,19 @@
   	}
   	else // inside a requestFlow or responseFlow elements
   	{
  -		if(XMLString::equals(__XTRC(localname), kw_param))
  +		if(XMLString::equals(lname, kw_param))
   		{  
   			GetParameters(m_lev2, attrs); //must be parameters of a handler or a chain
   		}
   
  -		else if(XMLString::equals(__XTRC(localname), kw_hdl))
  +		else if(XMLString::equals(lname, kw_hdl))
   		{  
   			m_lev2 = WSDD_HANDLER;
   			m_pHandler = new WSDDHandler();
   			ProcessAttributes(WSDD_HANDLER, attrs);
   			//get handler name and type if any
   		}
  -		else if(XMLString::equals(__XTRC(localname), kw_chain))
  +		else if(XMLString::equals(lname, kw_chain))
   		{
   
   		}
  
  
  

Mime
View raw message