Creating case sensitive XML Attributes

There was a question on a mailing list today complaining that CFMX creates XML attributes as all capitals. The user would do something like this:

Which of course produces an XML document that looks like this:

The trick is to use the array access notation instead of dot notation. Once you do that, your case is preserved. This is a complete example.

")>

One Response to “Creating case sensitive XML Attributes”

  1. Steven Erat says:

    Sam,

    Great post, thanks! I think that this may have solved the problem for which I created an xmlsearchnocase() udf. There is a change in behavior when running CFXML_Blog on CFMX U3 vs running on the upcoming maintenance release where xmlattribute names were lowercased but are now uppercased while using the same code. When I isolated the block of code used to save blog entries the difference in behavior could not be reproduced, so the problem must lie somewhere deeper in the blogging app. My udf doubles the work by searching for both cases (ignoring mixed case possibilities) and then joining them into a single array for return. With the information from this blog entry, I realize that I can just ensure that all xml attrs are created with structure syntax, and that should eliminate the need for a double-duty udf.

    -Steve

Leave a Reply