XPath is (almost) Perfection

A good friend of mine has recently been educating me on the advantages of Functional Programming. As part of that, he has demonstrated some pretty nifty examples of LINQ in C#. When I first heard about LINQ, I wasn't impressed. Having seen his examples of using LINQ for Functional Programming, however, I now see the advantage.

The consequence of this is that I now find it ugly to have to do loops just to get a subset of data. I want to just be able to describe the data that I want.


Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Hi Steve, I think this should solve your problem with upper/lower case:
<cfset aFields = XmlSearch(xData,"//field/relation[@onDelete='Error' or @ondelete='Error']/..")>
# Posted By John Whish | 8/30/08 12:35 PM

Right, except then I have this sort of mess in every XmlSearch statement:
<cfset aFields = XmlSearch(xData,"//field/relation[@onDelete='Error' or @ondelete='Error' or @ONDELETE='Error' OR @ONdelete = 'Error' or @onDELETE = 'Error' ]/..")>

Yeah, I could write a UDF to make my XPath statement, but at that point, my code is uglier than if I just wrote a loop to begin with.
# Posted By Steve Bryant | 8/30/08 12:38 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.