开发者

ColdFusion XMLSearch issue

开发者 https://www.devze.com 2023-03-21 09:31 出处:网络
This works: xmlSearch(开发者_运维技巧thisScheduleXml,\"/Schedules/Competition[@id = \'58\']/Match[@status != \'Complete\']\")>

This works:

xmlSearch(开发者_运维技巧thisScheduleXml,"/Schedules/Competition[@id = '58']/Match[@status != 'Complete']")>

This doesn't:

xmlSearch(thisScheduleXml,"/Schedules/Competition[@id = '<cfoutput>#url.competitionID#</cfoutput>']/Match[@status != 'Complete']")>

I don't get an obvious error as such; I just get back an empty struct with the second option.


Try to create the xpath string as a variable like:

<cfset match = "/Schedules/Competition[@id = '#url.competitionID#']/Match[@status != 'Complete']"> 
<cfset xmlSearch(thisScheduleXml,match)>


You can't use a CFOUTPUT tag in a function argument like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号