Discussion:
How do i stick coldfuion into xml file
(too old to reply)
JosBVG
2009-03-27 10:37:05 UTC
Permalink
I am very new to Coldfusion and i am struggling to get my head round this, so i
appologies if i am not using the correct terms.
All I need to do is put cold the correct cold fusion code into the
[b]your_image.jpg[/b] part of this xml file so that it pulls the correct image
out of our database.

<?xml version= "1.0"?><ZoomSettings

imageLink= "[b]your_image.jpg[/b]"
imageSmoothing= "true"

zoomMax= "400"
zoomOutToExtreme= "true"
zoomFactor= "5.0"
panSpeed= "5.0"
panWithinBoundary="true"
ease= "3.5"

etc etc etc
etc etc etc

I appreciate i have explained this in very simple terms but if anyone could
point me in the right direction it would be very much appreciated.
Jos
Mack
2009-03-27 11:15:07 UTC
Permalink
Post by JosBVG
I am very new to Coldfusion and i am struggling to get my head round this, so i
appologies if i am not using the correct terms.
All I need to do is put cold the correct cold fusion code into the
[b]your_image.jpg[/b] part of this xml file so that it pulls the correct image
out of our database.
<?xml version= "1.0"?><ZoomSettings
imageLink= "[b]your_image.jpg[/b]"
imageSmoothing= "true"
zoomMax= "400"
zoomOutToExtreme= "true"
zoomFactor= "5.0"
panSpeed= "5.0"
panWithinBoundary="true"
ease= "3.5"
<ZoomSettings imageLink=
"<cfoutput>http://www.yoursite.com/path_to_images/#your_image_variable#</cfoutput>"

where your_image_variable is a CF variable that contains your image file:
<cfset your_image_variable = "picnic_in_the_woods.jpg">
--
Mack
JosBVG
2009-03-27 14:43:15 UTC
Permalink
Hi
If i do it that way can i keep the file as xml file or do i need to save as cfm
Mack
2009-03-27 15:18:11 UTC
Permalink
Post by JosBVG
Hi
If i do it that way can i keep the file as xml file or do i need to save as cfm
You can save the file as .cfm and add

<cfheader name="Content-type" value="application/xml">

at the top of the file.
--
Mack
skelooth
2009-03-27 17:35:44 UTC
Permalink
or you can use xpath to find and change the value so that you can keep your xml files static.
Loading...