Hey Andy -

I just spent the better part of the day (I'm embarrassed to admit)
debugging a problem I was having with one of my XML AJaX requests that
used the code I included in this thread.  Although I looked at every
other piece of code before I got there, it ended up being an omission
in this code so I thought I'd update the list (and its archives) with
what I found.

Short version: I was trying to return XML for parsing via JavaScript. 
What I wasn't doing, though, was specifying the character set for that
returning XML.  Once my returning XML contained so much as an accented
"e" the functionality failed catastrophically.

To save anyone else the time and frustration, this fixed the problem:

<cfcontent type="text/xml; charset=UTF-8" reset="Yes" />
<cfoutput>
    ...myXML...
</cfoutput>

Moral: Be smarter than I am and ALWAYS specify a character set.

On 3/30/06, Andy Jarrett <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having some trouble create a valid XML document using cfheader to
> change the page content.
>
> My simple file looks like this:
>
> xml.cfm
>
> <?xml version="1.0" encoding="UTF-8"?>
> <root>
>         <node>
>                 <child>1</child>
>         </node>
> <root>
>
> I open this up and its valid. I know change the content type so the
> file is passed as XML:
>
> <cfheader name="Content-Type" value="text/xml">
> <?xml version="1.0" encoding="UTF-8"?>
> <root>
>         <node>
>                 <child>1</child>
>         </node>
> <root>
>
> This breaks the page. It seems that <cfheader> adds three blank lines
> to the top of the page.
>
> Has anyone else come across this problem?
>
> Cheers,
>
> Andy
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237036
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to