Cold Fusion RSS/XML Processing

Development and Programming, Web 1 Comment »

Having created a Cold Fusion-based RSS feed via XML before, I figured my most recent project needing this functionality would be a copy and paste job with some variable edits…wrong.

I’ve spent 2 days trying to figure out why the exact same code for a feed works differently on two identical Cold Fusion 8 servers.  The only difference was the database outputting the data, different database and different table.

After remembering that ALL good developers validate EVERYTHING they do before they start complaining of broken applications, I headed over to a RSS Validator and saw immediately that my file wasn’t valid in the first place.  My lovely Cold Fusion XML output functions have somehow put in 96 lines of blank space in the top of my code (this didn’t happen on the other server, mind you).

For future reference, encasing the ENTIRE set of code in processing tags like below and tightening up the code so that no blank spaces are present fix the problem:

<cfprocessingdirective suppresswhitespace=”yes”></cfprocessingdirective>

©2010 Tim Gilbreath, All Rights Reserved. Content on this site may not be reproduced without author's approval.
Entries RSS Comments RSS Log in