Can mono produce valid xhtml?
Posted
by z-boss
on Stack Overflow
See other posts from Stack Overflow
or by z-boss
Published on 2010-04-16T18:13:06Z
Indexed on
2010/04/16
18:53 UTC
Read the original article
Hit count: 276
I installed Mono and MonoDevelop 2.2 on my Windows PC.
Created a default C# ASP.NET Web Application project.
Here's the Default.aspx it created:
<%@ Page Language="C#" Inherits="test.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head runat="server">
<title>Default</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button id="button1" runat="server" Text="Click me!" OnClick="button1Clicked" />
</form>
</body>
</html>
When I run it it feeds this html to the browser:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head><title>
Default
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTQ2OTkzNDMyMWRkjWseIg+2HCgaNiY+XHmVKEq/CFg=" />
</div>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLB5qLABwKs34rGBvJAYc3UJn3AcjSPjq8DVpMxclAk" />
</div>
<input type="submit" name="button1" value="Click me!" id="button1" />
</form>
</body>
</html>
XHTML validation fails with 3 errors:
1. Line 3, Column 1: Missing xmlns attribute for element html. The value should be: http://www.w3.org/1999/xhtml
2. Line 8, Column 13: there is no attribute "name"
3. Line 17, Column 71: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag
Is there some setting I'm missing?
© Stack Overflow or respective owner