Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I should add to this that the error I'm receiving on xmlObject1 is:
Element ROOTELEMENT.XmlAttributes is undefined in XMLOBJECT1
I should also note that I do have the "-Dcoldfusion.xml.allowPathCharacters=true" JVM flag set from Patch 5 (I believe it was 5 where that was introduced).
Copy link to clipboard
Copied
Hi Mike, Can you please create a bug for this, we will investigate the issue.
Copy link to clipboard
Copied
Thanks Vivek - submitted under https://tracker.adobe.com/#/view/CF-4219824