Skip to main content
Inspiring
October 24, 2007
Question

XML Syntax Error

  • October 24, 2007
  • 2 replies
  • 563 views
I have a page with NO comments that output unicode in xml and sometimes it works, sometimes it says:
Incorrect syntax was used in a comment. Error processing resource ' http://www.netspeaknow.com/gamers/flashCFM/getPopQuiz.cf...

<!-- " ---></TD></TD></TD></TH></TH></TH></TR></TR></TR></TA...

but there are no comments. Even if there were why would this page only work about half the time? I have attached the code.

Thanks for any help!
    This topic has been closed for replies.

    2 replies

    Inspiring
    October 26, 2007
    Try wrapping all your code in <cfsilent>, and move you <cfcontent> down to
    the same line you're outputting your XML (ie: at the bottom).

    XML gets antsy if there is whitespace before the <?xml?> tag, or between
    that and the doctype (in my experience).

    I'd alos SERIOUSLY consider refactoring your approach to writing code so
    that you don't have a mix of processing, function declarations, DB calls
    and output all in the same CFM template. It's a bit of a mess.

    Also make sure you VAR all your variables in functions, and use
    <cfqueryparam> tags in your queries. Read up on when to use pound signs
    (and when not to), and when to use <cfoutput>.

    You only need pageencoding="UTF-8" on your template if the actual code has
    UTF-8 characters in it: it doesn't matter if the DATA you're processing is
    UTF-8; the <cfprocessingdirective> tag is a compiler instruction, not a
    ruuntime one. Otherwise it's just noise (cue: Paul Hatings disagreeing
    with that ;-)

    --
    Adam
    October 26, 2007
    Turn ColdFusion Debugging off...
    Or put <cfsetting showDebugOutput="false"/> at the top of the page
    Also, put a <cfcontent reset="true"/> at your last link where you toString your XML variable and <cfabort/> directly after that last line.