CF 2021 - Update 11 - XmlParse Functionality Broken?
We've updated our CF2021 non-production environments to Patch 11 which had an update to the java-xmlbuilder library.
With this update, code that we had running fine before is now failing.
I've created a small snippet of code to reproduce the issue. Here you can see I've got an XML String that I run through XmlParse twice - once with the caseSensitive flag set to true and the other with it defaulting to false.
When trying to read an XmlAttribute on the RootElement, I'm now getting an error on the object that was parsed with caseSensitivity set to true but the one with caseSensitivity = false is fine.
Here is a small snippet of code to explain what I'm seeing:
<cfscript>
xmlstring = '<?xml version="1.0" encoding="utf-16"?><RootElement userId="myuserId" password="myPassword" account="myAccount"></RootElement>';
xmlObject1 = xmlParse(xmlString, "yes");
xmlObject2 = xmlParse(xmlString);
try {
WriteDump("#xmlObject1.RootElement.XmlAttributes['userId']#");
}
catch(any e) {
WriteDump("Error Caught - #e.Message#");
}
WriteOutput("<br/>");
try {
WriteDump("#xmlObject2.RootElement.XmlAttributes['userId']#");
}
catch(any e) {
WriteDump("#e.Message#");
}
</cfscript>When I run this, I get an error on the xmlObject1 but not on xmlObject2. Prior to update 11, xmlObject1 would not have thrown an error.
I can't honestly say why we specify "yes" for the XmlParse function and setting it to "no" (or letting it default) seems to work but I'd rather not have to change all instances in our code if we don't have to. More importantly, I want to make sure this isn't a bug in Patch 11 that others may run into.
Any suggestions?
