Community
Participate
Working Groups
When validating newly created zend tutorial layout.phtml template with code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> validator gives following warnings: - Undefined attribute name (xml:lang). - Undefined attribute name (xmlns). The responsible component is "HTML Syntax Validator (for PHP Files)". If this component is turned off the default "HTML Syntax Validator" (without "for PHP File) validates "xml:lang" and "xmlns" attributes perfectly. Full template code is: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <?php echo $this->headTitle();?> </head> <body> <?php echo $this->layout()->content; ?> </body> </html>
Hi Alex What is "HTML Syntax Validator (for PHP Files)" and where is it?thanks
(In reply to comment #1) > Hi Alex > > What is "HTML Syntax Validator (for PHP Files)" and where is it?thanks Window => Preferences => Validation There are two types of HTML validators there: 1. HTML Syntax Validator 2. HTML Syntax Validator (for PHP Files) One can check off 'Manual' and 'Build' switches for validator (2) to disable these warnings. Checking/unchecking validator (1) switches has no effect.
Hi Alex Thanks for your reply! You can create a html file and then have the following content: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html> Then you will see HTML Syntax Validator have the same problem:)
The valid doctype is... e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> HTML Validator works well :)
Hi Toshihiro After I use <!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"> </html> I still get the warning.
Hi Zhao, No, I cannot reproduce your problem. HTML Validator works fine for me. BTW, you can download and look into DTDs. http://www.w3.org/TR/html4/strict.dtd doesn't have xmlns nor xml:lang attributes. http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd has both xmlns and xml:lang attributes. Also, you can use w3c Markup Validation Service. http://validator.w3.org/#validate_by_input Validation Service reports 'there is no attribute "XMLNS"' and 'there is no attribute "XML:LANG"' with 'Doctype: HTML 4.01 Strict'.
per Toshihiro reply, we can close this issue. if additional information is provided we can re-open this issue and better understand the problem (if any)
Closing this issue regarding Toshihro and Roy`s comments If have additional information about this will be reopened Closed by Teodor Kirkov teodor.k@zend.com
Hi, could you pls reopen the ticket? I have same situation: Lunar Eclipse + PDT from http://download.eclipse.org/releases/kepler same error validating php document <!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" lang="en"> gives me "Undefined attribute name (xmlns)" Also I cannot add "<?xml version="1.0" encoding="UTF-8" ?>", error is "syntax error, unexpected 'version'" Thanks.
Created attachment 235580 [details] to illustrate above
Andrei, Look at bug 415098 for your problem about validation error. - Do install "Eclipse XML Editors and Tools" or "Eclipse Web Developer Tools" from kepler repository. Look at Preferences>PHP>PHP Interpreter>Use Short Tags for your failure about syntax error. - Do uncheck it.
I solved this situation going to file>properties and changing the Text Default Encoding to UTF-8. Then I retyped the full html xmlns tag: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> The warning disappears.