Forum Moderators: coopster
"Note: many XHTML pages begin with an optional XML prologue ( <?xml> ) that precedes the DOCTYPE and namespace declarations. Unfortunately, this XML prologue causes problems in many browsers..."
I use PHP and XHTML 1.0 strict. I do this:
<?php echo '<?xml version="1.0" encoding="iso-8859-1"?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
Toadhall is wrong about this. You *want* the brackets. If you do not use bracks, but instead use < it will not recognize your xml tag as a tag, but as text and you don't want that.
Incidentally, I had trouble with Unicode and validation (because I don't have an editor that doesn't add the .... what is it? BMsomething and W3C chokes on validation. What have you done?
Tom
I don't understand. The site you listed looks perfect and you say the problem is not with your XHTML.
Then you say it isn't with PHP either, but you get a parse error, so that can only be PHP.
The PHP code that I posted works fine and generates valid XHTML. If you are getting a parse error, it's coming from somewhere else.
Try creating "skeleton" pages that just call stub functions (routines that just return without doing anything). Get rid of complexity until you locate the problem. If you still can't figure it out, post the code.
Tom
<?PHP print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
Also tried:
<?PHP echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
The reason for the URL in Profile was in reference to this
Incidentally, I had trouble with Unicode and validation (because I don't have an editor that doesn't add the .... what is it? BMsomething and W3C chokes on validation. What have you done?That was an example of Unicode and validated code.
<?PHP print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
1. Your parentheses don't match.
2. I'm not certain, but the standard is <?php. I'm not sure whether or not uppercase is allowed, though it would take two seconds to test (but I'm too lazy).
Also tried
<?PHP echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
That is exactly what I have, except for lowercase tags for invoking php, and it validates.
Tom
Syntax highlighting, code completion, all that sort of stuff is just eye candy. It can make things easier to read, but it doesn't help much in the end. Brace matching is such a help when your eyes just won't work. There are a lot of editors that support it.
- I've once had emacs set up for it (just parens for Scheme programming)
- I mostly use HAPedit, which does it pretty nicely, but I'm sort of biased there because I'm the one who made the feature request and so it's sort of done to the way I like it.
- I think TextPad, EditPad and UltraEdit can all do this, but I don't use them so I don't know.
Cheers,
Tom