xmlSearch is Always Case Sensitive

The ColdFusion function xmlSearch is always case sensitive, it seems, even if you specified case insensitive in the xmlParse function to create the XML object in the first place. So if you’re parsing an XML document that you don’t have complete control over (like an RSS feed), be careful. If there’s a chance the case could be different than what you’re expecting, make sure you search for both upper and lower case.

2 Responses to xmlSearch is Always Case Sensitive

  1. Christopher Wigginton says:

    Back in the CF5 days, I used to use Torchboxhttp://www.torchbox.com/xml/toolkit.cfmThey have a tag for CFMX as well. Its been awhile since I visited them and the main page link is currently deactived for maintenance( (at the time of posting this comment), but the sub link (above) still works. What was great about their tag is they converted XML to a query object where you could use Query of Queries to peform SQL selects on, allowing you to use the UPPER Function.Admittedly, XML can be complex, but their approach to the naming of children satisfied most requirements.

  2. Jeff Anderson says:

    One thing we use at work is to do a StructGet() around the XML object. This allows us to case insensitive “searching” via the Structure functions and notation.