我試圖顯示XMLSearch返回的XML節點數據,並且顯示數據時出現問題。我試圖輸出數據是這樣的:XML搜索和顯示節點信息
<cfset xmlBeatles=XMLParse(ExpandPath("Beatles.xml"))>
<cfset Qdata = XMLsearch(xmlBeatles,"//beatle[1]")>
#Qdata.beatle.firstname.xmltext# or #Qdata[1].beatle.firstname.xmltext#
,但我得到這個錯誤:
You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members.
示例XML:
感謝您的迴應保羅。可悲的是這個「Qdata.beatle.name.firstname.xmltext」不起作用。我得到了這個錯誤「您試圖將類型爲coldfusion.runtime.Array的標量變量解引用爲具有成員的結構。」任何建議? – user281867 2011-03-23 04:40:36