Results 1 to 2 of 2
  1. #1
    Abina's Avatar
    Abina is offline Master
    Join Date
    Dec 2009
    Location
    United States
    Posts
    1,073
    Thanks
    1
    Thanked 6 Times in 4 Posts
    Feedback Score
    0

    Default Coldfusion Paths and XSLT

    Hey I'm using cold-fusion to take a .XML file and mix it with a .XSL file
    My code is currently like this -

    Code:
    <!--- transform.cfm --->
    <cfset MyXmlFile = Expandpath("http://www.celticquicknews.co.uk/rss.xml")>
    <cffile action="READ" variable="xmlInput"  file="#MyXmlFile#">
    <cfset MyXmlFile = Expandpath("Stylesheets/celtrss.xsl")>
    <cffile action="READ" variable="xslInput" file="#MyXmlFile#">
    <cfset xmlOutput = XMLTransform(xmlInput, xslInput)>
    <!--- data is output --->
    <cfcontent type="text/html" reset="yes">
    <cfoutput>#xmloutput#</cfoutput>
    <cfinclude template="menu.html">

  2. #2
    numberone's Avatar
    numberone is offline Senior
    Join Date
    Jan 2010
    Posts
    623
    Thanks
    0
    Thanked 1 Time in 1 Post
    Feedback Score
    0

    Default

    What does "doesn't work" mean? Do you get an error...?

    Without knowing more, it looks like you're using both Expandpath() and CFFILE incorrectly. CFFILE reads files on _your_ local server. To read a url of a remote server you need to use CFHTTP.

    Also, ExpandPath() it is intended for use with a relative path on your server. For example, it can convert the shortcut for root "/" to a physical path like "C:\ColdFusion8\wwwrooot"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Partners: BOSTON WEB DEVELOPER, LLC   |   WEBCOSMO CLASSIFIEDS