Is the xml repetitive? In other words, would you have multiple <response>
tags in a single cfhttp.filecontent instance? If so, then you would just set
up the following to repeat the ## of times that the 'response' tags appear.
(personally, I would code to allow for multiple occurances as this would
cover me in for this type of expansion, if it isn't included already)
I would just parse the file.
Grab from the cfhttp.filecontent all of the text between the opening and
closing <response> tags.
There is no real fancy 'magic' here, just search for the known text values
and then extract the data between the opening and closing indicators.
1. isolate the <response> to </response> information
Responsetext = substring(cfhttp.filecontent, find(<response,
cfhttp.filecontent), find(</response, cfhttp.filecontent))
2. pull the data between the first and second quotes in the text string as
the 'valid' setting.
3. pull the <success> to </success> data out and the text in the middle
becomes your 'success' setting.
Wash. Rinse. Repeat.
Obviously this won't work 'verbatim' to what I have outlined here, but these
should work as good guidelines.
----------------------------------
William Seiter
IT Web Developer / Consultant
Is your income limited by the red tape and paperwork? Let SoftEx BackOffice
help you. They know how to take care of the 'busy work' of your contracts
and let you focus on the 'WOW' factor.
http://www.softexconsulting.com/softex_office.cfm
::-----Original Message-----
::From: Mike Little [mailto:[EMAIL PROTECTED]
::Sent: Sunday, October 12, 2008 8:52 PM
::To: cf-talk
::Subject: reading xml into a database
::
::hi guys, am hoping someone will find this one very easy...
::
::need to read the following xml child nodes into a database, including the
::attribute 'valid' in the root node.
::
::<?xml version="1.0" encoding="UTF-8" ?>
::<Response valid="1">
::<Success>1</Success>
::<TxnType>Auth</TxnType>
::<CurrencyInput>NZD</CurrencyInput>
::<MerchantReference>P20081013-14</MerchantReference>
::</Response>
::
::the xml is passed to my page as cfhttp.fileContent
::
::if anyone could help it would be great as i am getting nowhere!!
::
::mike
::
No virus found in this outgoing message.
Checked by AVG - http://www.avg.com
Version: 8.0.173 / Virus Database: 270.8.0/1721 - Release Date: 10/12/2008
12:00 PM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313799
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4