Fairly new to CF, and I realize this is an older thread but the same issue 
still applies.

I'm using CF8 and IE6.  I need the <?xml version="1.0" encoding="iso-8859-1"?> 
line in my XML output for IE to render it without the error ("An invalid 
character was found in text content...").  If I leave the <?xml version="1.0" 
encoding="UTF-8"?> line at the top I continue to get the error.  How do I 
automatically exchange/replace the encoding from UTF-8 to iso-8859-1?

I'm also having a little issue figuring out where to best put the <![CDATA[]]> 
so that it's not on every value.  Before the loop?

Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<cfstoredproc procedure="dbo.createStaffDir" DATASOURCE="OPMaster"> 
        <cfprocresult name="getemps">
</cfstoredproc>
</head>

<body>
<cfxml variable="employees">
<Employees> 
    <cfloop query="getemps"> 
       <Employee> 
       <cfloop list="#getemps.ColumnList#" index="field"> 
          <cfoutput> 
          <#field#> 
          <![CDATA[#xmlformat(getemps[field][currentrow])#]]>
          </#field#> 
          </cfoutput> 
       </cfloop> 
       </Employee> 
    </cfloop> 
</Employees> 
</cfxml> 

<!---<cfdump var=""> --->
<!---<cfoutput>#employees#</cfoutput>--->
<cfset XMLText=ToString(employees)>
<cffile action="write" file="D:\Inetpub\wwwroot\op\Wayne\employees.xml" 
output="#XMLText#">
</body>
</html> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313252
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to