Question : storing values from xmlparse in coldfusion

We are uploading xml files from our clients and then want to save the values from the xml in the database.   If I use: <CFOUTPUT>#xmlDoc.XmlRoot.Student.ContactInfo.PrimaryPhoneNumber#</CFOUTPUT> I get the value back 5123826201.   However if I try to update the db with update apps set phone = #xmlDoc.XmlRoot.Student.ContactInfo.PrimaryPhoneNumber# I get           update apps set phone = '<?xml version="1.0" encoding="UTF-8"?> <sds:PrimaryPhoneNumber xmlns:sds="http://scholarshipproviders.org/scholarshipapplication">5123826201</sds:PrimaryPhoneNumber>'

What am I doing wrong??

Answer : storing values from xmlparse in coldfusion

#xmlDoc.XmlRoot.Student.ContactInfo.PrimaryPhoneNumber# is a complex xml element.  You probably want the XMLText attribute of that element (ie the value)

#xmlDoc.XmlRoot.Student.ContactInfo.PrimaryPhoneNumber.xmlText#
Random Solutions  
 
programming4us programming4us