Why the select tag need to have at least on child to be valid xhtml 1.0 ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Why select tag need at least one child to be xhtml valid ?</title>
</head>
<body>
Allowed users :<br/>
<select size="5" style="width: 200px">
</select>
<br />
Alls users :<br/>
<select size="5" style="width: 200px">
<option>root</option>
<option>John Doe</option>
<option>Jane Doe</option>
</select>
</body>
</html>
To be valid, I need to write :
<select><option/></select>
I think it's useless and it's cumbersome to add the empty option tag programmatically (especially in ASP.NET WebForms, I use a DropDownList or ListBox control with a dataBind) :
if count == 0 then add <option/>...
There is no explanation in the DTD : http://www.w3.org/TR/xhtml1/dtds.html
Do you know why W3C validation require that ?
(And how can I make this page valid using a DropDownList or ListBox control in ASP.NET WebForms 4.0 ?)