In what case would you use XML with ColdFusion
In what case would you use XML with ColdFusion? I am thinking the only situation you would use XML instead of a database is on CD. However, if it is on CD, you can't use ColdFusion. You need to have access to a coldfusion server to process coldfusion page. Can you or someone give me several situations where XML would be used instead of database if you have a database?
Johnny
Posted by: Johnny
Posted on: 04/08/2004 10:05 PM
|
When to use XML
XML should be used when you want to deliver information to third-party easily... Take into account the Tutorial Feeds on this site:
http://www.easycfm.com/syndication/EasyFeed.xml
They allow people who run ColdFusion related sites to display tutorials on their site easily...
You can also keep information in a temporary XML structure that will contain specific information about a logged in user...
Truth be told.. the possibilities are pretty much endless.
XML was not created to replace the database.. it was created to allow the exchange of information to be easier.. since all XML ends up being processed the same, etc.. so it's a standard that is uses to create and parse data between two systems!
Posted by: Pablo Varando
Posted on: 04/14/2004 10:33 AM
|
simplification
thanks for the example, I hadn't used xml in cf yet, and I had to retrieve 3rd party content as you explained in last post. I have simplified your code a bit to avoid headaches :)) I put it here in case someone would reuse your example:
<cfhttp url="http://www.xp-resources.com/easycfm.xml" method="GET"> <!--- using this list instead of enumeration ---> <cfset fieldsList = title,url,author,platform,description,xmlAttributes">
<cfscript> xmlfile = xmlparse(cfhttp.filecontent); //Parses the XML xmlsize = arraylen(xmlfile.Tutorials.xmlchildren); //Tutorials is the parent tree xmlqry = QueryNew(#fieldsList#); //Sets a query for output QueryAddRow(xmlqry,xmlsize);
for(a=1;a LTE xmlsize;a=a+1) { for(b=1;b LT listLen(fieldsList);b=b+1) { QuerySetCell(xmlqry,listGetAt(fieldsList, b),xmlfile.Tutorials.TutorialID[a][listGetAt(fieldsList, b)].xmlText,a); } } </cfscript> <cfquery name="tutorials" dbtype="query"> SELECT * FROM xmlqry ORDER BY eventid asc </cfquery>
<cfoutput query="tutorials"> <cfloop list="#fieldsList#" index="zzz"> #zzz# #evaluate(zzz)#<br> </cfloop> </cfoutput>
Posted by: pim
Posted on: 08/26/2004 06:52 AM
|
simplification(2)
little correction :
<cfquery name="tutorials" dbtype="query"> SELECT * FROM xmlqry ORDER BY eventid asc </cfquery>
should be
<cfquery name="tutorials" dbtype="query"> SELECT * FROM xmlqry ORDER BY id desc </cfquery>
Posted by: pim
Posted on: 08/26/2004 06:54 AM
|
Parse XML using ColdFusion 4.5
I tried using this tutorial with CF 4.5 and got a <cfquery> error becuase no datasource was declared. So I put it on our Web server, which is running 5.0. Can XML be parsed using this version?
Pat
Posted by: Pat
Posted on: 09/21/2004 10:03 AM
|
Query of Queries
4.5 doesn't support query of queries so the dbtype of query is what's breaking it for you...
Posted by: Jamie Martin
Posted on: 10/11/2004 02:04 PM
|
XML to SQL
I am trying to take an XML file into SQL so that I can run queries on it. We collect stats from one company, put the data into our database and run reports off it. The reports have several calculations so I don't feel that running xml queries is the best method.
The data file is pure XML. I am not sure how to get into a format that can be insert into a table?
can anyone help?
Posted by: David Humphrey
Posted on: 11/17/2004 06:43 PM
|
Where's the XML file?
Can you send me the XML file. The URL seems to be out dated
Posted by: JacktheRipper
Posted on: 11/18/2004 04:48 PM
|
Post the answer please
I'd like to see that solution. I have an XML from ebay that i want to dump into a mySQL database. I don't know anything about XML. help.
Posted by: Rob
Posted on: 11/20/2004 02:34 PM
|
XML -> SQL how'd ya do it?
What was the solution to the XML-SQL Problem? is there an easy way to do it? Has anyone here used SQLXML? is there a clean way to do it in CF?
Posted by: Jamie Martin
Posted on: 12/13/2004 01:36 PM
|
XML->SQL Use example, replace setcell
replace setcell with insert query, pretty much (first example is pretty easy to read)
Posted by: d
Posted on: 03/15/2005 01:55 AM
|
Feedburner
I posted this elsewhere, but maybe it can get answer here too.
These parsing things break on Feedburner feeds because instead of <link>URL</link> in the XML, it has <link href="LINK" /> so you get " " instead of "http://yourlink.com" for the output. (Link is an empty tag in their feed.)
Ideas?
Posted by: nikole
Posted on: 03/18/2007 02:52 AM
|