XML as possible storage solution?


i have couple of forms have @ least 100 fields on them. 4 or 5 fields need stored in sql db, entire form needs able saved draft, upon final submittal saved pdf historical purposes.

rather add of columns db don't need there, thinking upon saving draft save form xml file. way when brought reference xml tags cfform editing. have never used xml before, thinking functionality correctly? if so, effective way accomplish this? see there cfxml tag , xmlnew function, i'm not sure 1 should use. guidance appreciated!

we time. use xml small data stores
it not worth set database.

the basics follows.
you use <cffile ...> tags read , write xml files.
you can use <cfxml>, xmlnew(), or <cfsavecontent> tags create
xml, capable , use depends on want do.
you want aware of xmlparse() convert text files
cf xml objects , tostring() convert cf xml objects text.

a quick , dirty example.

<cfsavecontent variable="somexml">
<?xml version="1.0" encoding="iso-8859-1"?>
<root>
<fieldone></fieldone>
<fieldtwo></fieldtwo>
<fieldthree></fieldthree>
<root>
</cfsavecontent>

<cfset xmlobj = xmlparse(somexml)>
<cfdump var="#xmlobj#">

<cffile action="write" output="#tostring(xmlobj)#" ...>

<cffile action="read" variable="newxml" ...>
<cfset newxmlobj = xmlparse(newxml)>
<cfdump var="#newxmlobj#>



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support