Cannot xmlSearch in CF2016
Hello all
I have this xml file:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<SoapRequestResponse xmlns="http://tempuri.org/">
<SoapRequestResult>
<ExtensionData />
<Successful>Y</Successful>
<ResponseCode>9999</ResponseCode>
<HeaderMessage>Success</HeaderMessage>
<ItemMessages />
<ClientTracking>xxxxx</ClientTracking>
<TotalTax>7.32641</TotalTax>
<TransId>1234567890</TransId>
<GroupList>
<Group>
<ExtensionData />
<LineNumber>1</LineNumber>
<StateCode>NY</StateCode>
<InvoiceNumber>12345</InvoiceNumber>
<CustomerNumber>98765</CustomerNumber>
<TaxList>
<Tax>
<ExtensionData />
<TaxTypeCode>101</TaxTypeCode>
<TaxTypeDesc>STATE SALES TAX</TaxTypeDesc>
<TaxAmount>1.17698</TaxAmount>
<Revenue>24.99</Revenue>
<CountyName>SUFFOLK</CountyName>
<CityName>AMITY HARBOR</CityName>
<TaxRate>0.040000000000</TaxRate>
<PercentTaxable>1.000000</PercentTaxable>
<FeeRate>0</FeeRate>
<RevenueBase>29.42450</RevenueBase>
<TaxOnTax>0.17738</TaxOnTax>
</Tax>
<Tax>
<ExtensionData />
<TaxTypeCode>202</TaxTypeCode>
<TaxTypeDesc>COUNTY SALES TAX</TaxTypeDesc>
<TaxAmount>1.25055</TaxAmount>
<Revenue>24.99</Revenue>
<CountyName>SUFFOLK</CountyName>
<CityName>AMITY HARBOR</CityName>
<TaxRate>0.042500000000</TaxRate>
<PercentTaxable>1.000000</PercentTaxable>
<FeeRate>0</FeeRate>
<RevenueBase>29.42471</RevenueBase>
<TaxOnTax>0.18847</TaxOnTax>
</Tax>
</TaxList>
</Group>
</GroupList>
</SoapRequestResult>
</SoapRequestResponse>
</soap:Body>
</soap:Envelope>
In CF9 - i used these commands after calling cfhttp:
<cfset xmlParseIn = XmlParse(taxResponse.filecontent)>
<cfset responseResult = xmlSearch(xmlParseIn,"//*[ local-name() = 'SoapRequestResult' ]") />
Which produced an array that I would then deal with in subsequent code.
Now in CF2016 (using same xmlParse and xmlSearch) I get this error:
Detail: ColdFusion is unable to process the result of the XPath search. You may have an undefined variable in the xpath expression.
Message: Unable to process the result of the XMLSearch for ''.
Can someone give me some direction. We were forced on CF2016, after a CF9 crash, so now I'm under the gun! ![]()
thanks in advance
Artie
