Posted by Denk 3 years 39 weeks ago
I also posted this on the training-page itself, but seeing i aint getting a response there, i though 'lets post it on the forum' ;)
Hi
The tutorial is really helpful, but I have a problem near the start...
The tutorial says that we 'could' use the HTML Validator extension to check if our pages are valid.
My first 2 lines in my code are:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
(had to add a space or the site didn't want to show this line)
Now, the validator already goes 'berserk' that it doesn't recognize the DTD, since it's not an official W3C DTD.
I'm fairly sure the both lines are correct, so I don't really understand why the tutorial says that we could use that seeing it clearly doesn't work...
Any advice?
Kinds regards,
Denk
If the answer is: you can't use that doctype with that plugin. Do you guys and/or girls use some kind of other plugin to easily check whether the site is conform with the doctype or not?




Posted by ruadhan 3 years ago
Mobile Champion
Hi Denk,
We came across this problem a while back.
Ruadhan O'DonoghueYou are right, the code in the tutorial is correct, but the HTML validator doesn't recognise the XHTML MP doctype. To get the HTML Validator Firefox extension to work you can change the Validation configuration to use the Tidy algorithm. We have more info in this forum thread.
dotMobi
Posted by Denk 3 years ago
wicked :D
thx for the fast reply btw m8 ;)
grtz Yannick
Posted by Denk 3 years ago
another problem
First line of my index.php is:
<?xml version="1.0" encoding="utf-8"?>
My browser says:
Parse error: syntax error, unexpected T_STRING in ......index.php on line 1 and ready.mobi can't even parse it nor can the w3c validator check the page
So, i conclude that the <?xml ... has to be removed, but why is it in the training then? ;)
grtz Yannick
Posted by ruadhan 3 years ago
Mobile Champion
In PHP (depending on how your server is set up), it can be better sometimes to print out this line instead of putting it straight into the file i.e.
dotMobi
Posted by daniel.hunt 3 years ago
Mobile Grandmaster
Actually, I believe that there's a badly configured webserver at fault here!
I've heard rumours of Apache being told to parse a .php file as php, and not bother looking for the opening <?php tag (admittedly, this was quite some time ago, so my memory is slightly fuzzy on it now). If this is indeed what's causing the error, then the reason why <?xml is killing your internet is because its not a valid php tag!
Odds are that if you can discover why the webserver is configured in this way (and, hopefully, have it changed), then you can avoid the unnecessary printing of the xml tag from within php (like you're trying to do)!
Daniel HuntdotMobi
Posted by ruadhan 3 years ago
Mobile Champion
I believe too that PHP servers can be configured to parse PHP on '<?' as well as '<?php', and so the xml declaration will be interpreted as PHP...
Ruadhan O'DonoghuedotMobi
Posted by daniel.hunt 3 years ago
Mobile Grandmaster
Actually I'm not sure that the <? and <?xml will be confused... I hadn't thought of that though
*edit*
Daniel HuntI'm almost 100% positive that <?xml won't be confused with <?
dotMobi
Posted by ruadhan 3 years ago
Mobile Champion
I think it's more that the '<?' is being treated the same in either case, but the 'xml version...' is interpreted as PHP, and of course it's not!
Ruadhan O'DonoghuedotMobi
Posted by daniel.hunt 3 years ago
Mobile Grandmaster
Right then! It's a challenge!
/me runs off to test
Daniel HuntdotMobi
Posted by daniel.hunt 3 years ago
Mobile Grandmaster
OK - I concede - you win :(
Daniel HuntdotMobi
Posted by Denk 3 years ago
works if i use the print '<?xml .........' :D
thanks once more ruadhan :D