• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF inside XML

Guest
Oct 25, 2006 Oct 25, 2006

Copy link to clipboard

Copied

I've been running into walls with a similar problem of executing CF from a database recordset for years, and now I'm trying to do something similar with XML. What I have is an XML file with CFML inside the CDATA of my tag. There is also some html I want to be displayed. I can't seem to get the CFML executed it. I was thinking of using evaluate() but that will try to execute all my html as variables or something. Is there some sort of executeCF() function or something I could use to only process the CF in a variable. Or is there some attribute of the XML object that will switch on CF interpretation? All I'm trying to do is set some variables in my XML, so it's not any heavy duty stuff. I could possibly write a RE, but I was wondering if there was a cover all solution. Thanks in advance!

~Ben~
TOPICS
Advanced techniques

Views

418

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

Write query-data to a file on HD.
Include file.
Delete file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 26, 2006 Oct 26, 2006

Copy link to clipboard

Copied

I think that was a solution I had come up with about 4 years ago when I was trying to do the same thing with database queries, but I comepletely forgot about it. Is that gonna make my server extremely vulnerable using CFFile everytime do anything involving a query. Forget vulnerable, how much will that slow things down if I have a loop of queries? Luckily, I only have one per page this time, but what about future situations? Either way, thank you very much for your reply. Whenever I have a problem that's got me banging my head on my desk, I always goto you guys!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 27, 2006 Oct 27, 2006

Copy link to clipboard

Copied

Overall it is a sub-ideal way.

- No file (compiled-code) caching by CF.
- File-writing can be rather slow on VirtualMachine-servers.
...

Better write the files to disc from start and only save the file-name/path in DB.
<cfinclude template="#myQuery.myFile#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 27, 2006 Oct 27, 2006

Copy link to clipboard

Copied

I'm suprised Ben Forta's never gone "hmm, I wonder if we can create a tag so we can execute cf code from a variable". I mean we have evaluate, but that will treat every word in my variable as a variable itself. We need like an "execute()" or something. Maybe I can take a month off and develop it or something =D

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 27, 2006 Oct 27, 2006

Copy link to clipboard

Copied

LATEST
Creating a tag or UDF-function that does the write-File -> include file -> delete-file is rather simple, a matter of 15 minutes or so!

But as mentioned I'd consider it bad practice ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation