Uploaded image for project: 'Lucee Development'
  1. LDEV-492

XML objects don't cast to string properly

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.49, 4.5.1.022
    • Fix Version/s: 4.5.2.008, 5.0.0.61
    • Labels:
      None

      Description

      dir = expandPath("./");
      platform = structKeyExists(server, "lucee") ? "lucee" : "coldFusion";
      xml = xmlParse("#dir#before.html");
      fileWrite("#dir##platform#.xml", xml);	
      

      Expected:
      XML is written to file (this is what ColdFusion does)

      Actual:

      Lucee 4.5.1.022 Error (java.io.IOException)
      Message	can't write down object of type [struct] to resource [C:\apps\lucee\4.5\express\webapps\ROOT\shared\cfml\vendor\lucee\incompats\xml\lucee.xml]
      Cause	java.io.IOException
      Stacktrace	The Error Occurred in
      C:\apps\lucee\4.5\express\webapps\ROOT\shared\cfml\vendor\lucee\incompats\xml\convertHtml2Xml.cfm: line 5 
      3: platform = structKeyExists(server, "lucee") ? "lucee" : "coldFusion";
      4: xml = xmlParse("#dir#before.html");
      5: fileWrite("#dir##platform#.xml", xml);	
      6: </cfscript>
      

      I think the issue here is that Lucee's XML object doesn't seem to have the toString() method implemented, which it ought to have. This might be because you're just using a struct rather than a specific XML class? Judging from the mention of structs in the error message I mean.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              da_cameron Adam Cameron
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: