user460114
user460114

Reputation: 1848

ColdFusion XMLSearch issue

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.

Upvotes: 0

Views: 174

Answers (2)

Andrea Campolonghi
Andrea Campolonghi

Reputation: 580

Try to create the xpath string as a variable like:

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

Upvotes: 1

Sean Coyne
Sean Coyne

Reputation: 3884

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

Upvotes: 0

Related Questions