I have this script that runs queries, and outputs it in XML format. Here is a snippet of what comes out if I print to screen:
<?xml version="1.0" encoding="ISO-8859-1"?>
<dataset>
<cdr>
<id>08-15-2007.09 </id>
<col2>202</col2>
<col3>7</col3>
<col4>7</col4>
<col5>0</col5>
<col6> 0.0</col6>
<col7>100</col7>
<col8> 1</col8>
<col9> </col9>
<col10>2007-08-15 09:57:56</col10>
</cdr><cdr>
<id>08-15-2007.09 </id>
<col2>202</col2>
<col3>8</col3>
<col4>8</col4>
<col5>0</col5>
<col6>1414.5</col6>
<col7>100</col7>
<col8> 1</col8>
<col9>10608</col9>
<col10>2007-08-15 09:57:56</col10>
</cdr><cdr>
<id>08-15-2007.11 </id>
<col2>240</col2>
<col3>12</col3>
<col4>12</col4>
<col5>0</col5>
<col6> 0.0</col6>
<col7>100</col7>
<col8> 2</col8>
<col9> </col9>
<col10>2007-08-15 11:57:15</col10>
</cdr></dataset>
I am trying to push it back to the browser and I get this error in apache log
malformed header from script. Bad header=<?xml version="1.0" encoding=
+": rpt.pl
This is how I print the header:
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
print "<dataset>\n";
print @output;
print "</dataset>";
I got that header from the w3school.com website, so I am a bit confused on what the browser wants. Also, the file I wrote to looks exactly like the above data sample, but much larger, and the browser can't read it.