user1448260
user1448260

Reputation: 263

xhtml not valid after inserting php call

I insert into Magento template:

xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">

Which is taken directly from the modern default theme that comes with magento version 1.7. However upon trying to validate the page with W3C i get this error:

Line 325, Column 10: end tag for "html" omitted, but OMITTAG NO was specified. You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

 Line 2, Column 1: start tag was here
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Any idea how to fix this? I haven't modified header.phtml and don't have a custom one in my theme folder...

Upvotes: 1

Views: 146

Answers (2)

Konrad Neuwirth
Konrad Neuwirth

Reputation: 898

Does your template include the tag at the end – the end tag for html that the validator actually complains about?

Upvotes: 3

user2428118
user2428118

Reputation: 8114

It appears you're trying to validate your PHP document instead of the generated HTML. Don't do this. Put the .php on a web server, access the server through your browser and validate the resulting source code.

Upvotes: 1

Related Questions