按位置在xml中分配值

时间:2017-09-20 12:49:01

标签: xml coldfusion

我有xml数据XMLData,类似这样:

<cfset TransactionInformation = 
[
    {    
         VariableName = "someData", 
         XMLLocation="HX5.HTML_Reports.HTML_Report.XMLText", 
         Value="" 
    }
]/>

我正在尝试执行以下操作:

<cfloop array="#TransactionInformation#" index="Field" >
    <cftry>
           <cfset Field['Value'] = "#XMLData[Field['XMLLocation'] ]#" /> 
    <cfcatch>
        <!--- some error catching --->
    </cfcatch>
    <cftry>
</cfloop>

这会引发错误,#XMLData[Field['XMLLocation'] ]#我认为这不是正确的语法。可以这样做,怎么做?

错误

Element HX5.HTML_Reports.HTML_Report.XMLText is undefined in a Java object of type class coldfusion.xml.XmlNodeList.

0 个答案:

没有答案