• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF 2021 - Update 11 - XmlParse Functionality Broken?

New Here ,
Nov 13, 2023 Nov 13, 2023

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?

 

Views

117

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2023 Nov 13, 2023

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 16, 2023 Nov 16, 2023

Copy link to clipboard

Copied

Hi Mike, Can you please create a bug for this, we will investigate the issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 16, 2023 Nov 16, 2023

Copy link to clipboard

Copied

LATEST

Thanks Vivek - submitted under https://tracker.adobe.com/#/view/CF-4219824

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation