Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313859

Summary: Undefined attribute name: xml:lang, xmlns
Product: z_Archived Reporter: Alex <ross>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P1 CC: djfd, gadi, ganoro
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
to illustrate above none

Description Alex CLA 2010-05-21 02:34:42 EDT
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>
Comment 1 Zhongwei Zhao CLA 2010-05-25 00:12:01 EDT
Hi Alex

What is "HTML Syntax Validator (for PHP Files)" and where is it?thanks
Comment 2 Alex CLA 2010-05-25 13:19:27 EDT
(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.
Comment 3 Zhongwei Zhao CLA 2010-05-25 21:44:13 EDT
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:)
Comment 4 Toshihiro Izumi CLA 2010-05-30 04:34:27 EDT
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 :)
Comment 5 Zhongwei Zhao CLA 2010-05-30 22:44:13 EDT
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.
Comment 6 Toshihiro Izumi CLA 2010-06-01 08:26:22 EDT
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'.
Comment 7 Roy Ganor CLA 2010-06-01 09:03:03 EDT
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)
Comment 8 Gadi Goldbarg CLA 2010-06-17 10:56:08 EDT
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
Comment 9 Andrei M. CLA 2013-09-17 18:36:22 EDT
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.
Comment 10 Andrei M. CLA 2013-09-17 18:37:50 EDT
Created attachment 235580 [details]
to illustrate above
Comment 11 Toshihiro Izumi CLA 2013-09-20 19:35:16 EDT
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.
Comment 12 Marc Albert CLA 2013-12-09 19:36:33 EST
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.