1 person found this helpful
See my comment on Ben Nadel's blog: http://www.bennadel.com/blog/1491-Ask-Ben-Finding-XML-Nodes-That-Have-Children-With-The-Gi ven-Case-Insensitive-Phrase.htm.
There's another couple of options here Ben:
<cfset aNoCase1 = xmlSearch(xmlFeed, "//item[contains(translate(title/text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'coldfusion')]")>
It's a bit long-winded, but it works.
This next one conditionally works... it's OK for looking up the count of results, but as it transforms the XML, one has to be cautious with what one does with the results:
<cfset aNoCase2 = xmlSearch(lcase(xmlFeed), lcase("//item[contains(title/text(), 'COLDFusion')]"))>
Another note here is that the the nodes in the resultant array are not references to the original nodes, they're references to a separate XML doc which is created by the lcase(xmlFeed) operation. So one cannot update the nodes in the array and expect to see the updates in the original doc (like one usually would). So this one comes with some caveats, but if those are not a concern: it's an adequate approach.
I ended up going with another method over the xmlsearch for this. I've included the code below
<CFSet xmlDoc = XMLParse(xml)>
<cfset jobs = xmldoc.root.XmlChildren>
<cfset size = ArrayLen(jobs)>
<!--- create a query object with the job data --->
<cfset myquery = QueryNew("JobID, Title") >
<cfset temp = QueryAddRow(myquery, #size#)>
<cfloop index="i" from = "1" to = #size#>
<cfset temp = QuerySetCell(myquery, "JobID",
<cfset temp = QuerySetCell(myquery, "Title",
<!--- Select entries with the Title name starting with N and dump the result --->
<cfquery name="ImqTest" dbType="query">
SELECT JobID, Title