我在USPS Rate Calculator API中使用以下代码:
<cfscript>
variables.RateV4 = variables.usps.RateV4(
Service = 'FIRST CLASS',
FirstClassMailType = 'LETTER',
ZipOrigination = '44106',
ZipDestination = '20770',
Pounds = '0',
Ounces = '3.5',
Size = 'Regular'
);
WriteDump(var="#variables.RateV4#" label="RateV4");
</cfscript>
输出类似于:
RateV4 - xml document [long version]
RateV4Response XmlText
Package xmltext
.
'
Postage xmltext
.
.
Rate xmlText 1.06
如何将 rate 对象转换为简单的 CF 变量?IE
<cfoutput>#RateV4.Package.Postage.rate.XmlText#</cfoutput>
我尝试了一堆格式都没有成功。