Skip to main content
Participant
March 27, 2009
Question

How do i stick coldfusion into xml file

  • March 27, 2009
  • 4 replies
  • 560 views
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 your_image.jpg part of this xml file so that it pulls the correct image out of our database.

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

imageLink= " your_image.jpg"
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
    This topic has been closed for replies.

    4 replies

    Inspiring
    March 27, 2009
    or you can use xpath to find and change the value so that you can keep your xml files static.
    Inspiring
    March 27, 2009
    JosBVG wrote:
    > 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
    JosBVGAuthor
    Participant
    March 27, 2009
    Hi
    If i do it that way can i keep the file as xml file or do i need to save as cfm
    Inspiring
    March 27, 2009
    JosBVG wrote:
    > 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
    > your_image.jpg part of this xml file so that it pulls the correct image
    > out of our database.
    >
    > <?xml version= "1.0"?><ZoomSettings
    >
    > imageLink= " your_image.jpg"
    > 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