Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-1765

XML Element type lost when using .iterator() on an array of XMLElement

    Details

      Description

      Hello everyone,
      I'm Christophe Lau and I am Web Developper for Activ Browser Technology.

      I found this bug when playing with LastFM API for my personal home page.
      It seems that there's a problem when using .iterator() method on an array of XMLElement.
      Here is the code to reproduce it:

      --> test.cfm
      <cfxml variable="xml">
      <cars>
      <car name="Mercedes Something"></car>
      <car name="Ferrari Thing"></car>
      <car name="Renault Stuff"></car>
      </cars>
      </cfxml>

      <cfscript>
      xmlCarsArray = xml.cars.XMLChildren;
      writeDump(xmlCarsArray);

      //This is Ok on Railo and ColdFusion Server:
      for (i = 1; i <= arrayLen(xmlCarsArray); i++)

      { xmlCar = xmlCarsArray[i]; writeDump(xmlCar); }

      //This is Ok on ColdFusion Server but will bug on Railo:
      xmlCarsIterator = xmlCarsArray.iterator();
      while (xmlCarsIterator.hasNext())

      { xmlCar = xmlCarsIterator.next(); //Here I lost XMLElement Type; xmlCar is now a string writeDump(xmlCar); }

      </cfscript>

      Thanks,
      Christophe

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                c_lau91 Christophe Lau
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: