|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-05-01 22:20 UTC] hrothgar at techie dot com
Situation: I'm trying to use XHTML (HTML meets XML) to build a site. In my current implementation, I'm trying to use an `include` statement to insert the workings of a header.php file, but for simplification purposes, I've reduced the problem down to a single, *static* file for the parser to chew on. Consider the file, test.php, to illustrate the problem: >>>test.php <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>foo</head> <body>bar</body> </html> <<<test.php I get the following parse error when trying to view this: Parse error: parse error in /home/httpd/html/test.php on line 1 It appears that the php parser is not respecting the `<?xml` tag as being a non-php tag. If a non-php `<?*` tag is found, the parser should simply quote the tag instead of just dieing (IMHO). Thanks configuration: ./configure --with-mysql --with-axps --disable-debug apache 1.3.9 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
A solution is to write : <?php echo('<?xml version="1.0" encoding="UTF-8"?>'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">