CodeIgniter Forums
XML causing an error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: XML causing an error (/showthread.php?tid=22956)



XML causing an error - El Forum - 09-24-2009

[eluser]tdktank59[/eluser]
So for some reason in my view file I hate this line of code

Code:
<?xml version="1.0" encoding="utf-8" ?>

And for some reason it throws an error when I call the file.

any ideas? this is valid xml tags so I don't get why it is doing this

Code:
function index()
{
$this->load->view('file1');
}

Fresh install of CI, nothing autoloaded. configured enough to make it work.


XML causing an error - El Forum - 09-24-2009

[eluser]wabu[/eluser]
What's the error message? I tried a quick test and it works for me.


XML causing an error - El Forum - 09-24-2009

[eluser]tdktank59[/eluser]
Quote:[24-Sep-2009 17:52:00] PHP Parse error: syntax error, unexpected T_STRING in /home/fourtwo1/public_html/dirt/application/views/blah.php on line 1



XML causing an error - El Forum - 09-24-2009

[eluser]wabu[/eluser]
Oh, I get the same error with short tags enabled (guess it's trying to parse it).


XML causing an error - El Forum - 09-24-2009

[eluser]BrianDHall[/eluser]
Yes, this is a tad annoying, so here is fix:

Code:
<? echo '<?xml version="1.0" encoding="utf-8"?>' ?>



XML causing an error - El Forum - 09-24-2009

[eluser]tdktank59[/eluser]
[quote author="BrianDHall" date="1253848526"]Yes, this is a tad annoying, so here is fix:

Code:
<? echo '<?xml version="1.0" encoding="utf-8"?>' ?>
[/quote]

Short tags are off...
Or I guess its php doing it...

O the joys of php lol