Skip to main content
Participant
April 19, 2010
Question

How can I format the XML file that was uploaded to the website using ColdFusion and read from it?

  • April 19, 2010
  • 1 reply
  • 300 views

Hi,

I've uploaded the xml file to the website and read using

               <cffile action="upload" filefield="myfile" destination="#expandpath('./')#" nameconflict="overwrite">
               <cfset myXMLDocument=XmlParse("#expandpath('./')##CFFILE.serverfile#")>
               <cfdump var="#myXMLDocument#">

but my assigment needs me to edit the field and format it before I show the content on the website.

Eg: I got the price, and the quantity column from the xml...then i need to calculate the total price(price*quantity) and display

as Price, Quantity and Total Price on the website.

Is there a way that I could do that? So far I am stuck after reading the raw xml file and displaying the raw data only

Help would be really appreciated.

Thank you all.

    This topic has been closed for replies.

    1 reply

    April 19, 2010

    Use dot notation to drill down into an xml file. For example rss.channel.item.name.firstname.xmltext.