For example, consider the following code snippet:
Scenario 1:
The name of the company I received as part of the SOAP response is as follows:
<Company>Amazon, Inc </Company>
Scenario 2:
Another company name that I received as part of the SOAP response is as follows:
<Company>Google, Inc </Company>
In principle, from the end of the user I entered some information and based on this I get different company names inside the tag <Company>.
The following code shows how I save the response in an XMLResponse variable
<cfset XMLResponse = XmlParse(
httpResponse.fileContent.Trim()
) />
The following code snippet shows how I parse the response and save the contents in a variable:
<cfset arrCOMPANY = XmlSearch(
XMLResponse,
"//*[name()='Company']"
) />
So now I have arrCOMPANY = Amazon, Inc, I get into the script and Google, Inc otherwise.
My question is:
, 1, - Amazon, Inc
.
, , :
cfqueries, , :
<cfif arrCompany eq "Amazon, Inc">
Or
<cfif arrCompany eq "Google, Inc">
, , , , eq, .
(, Amazon Inc).
.
:
. :
CompanyName Amazon, Inc
<cfset CompanyName = Trim(arrCompany[1])>
cfif:
<cfif CompanyName eq "Amazon, Inc">
<cfset m = 1>
<cfelse>
<cfset m = 0>
</cfif>
<cfoutput>#m#</cfoutput>
, 0 . , , .