Ran into an odd problem, spurred by a post on both ASP.NET and GotDotNet.com, where the poster was having problems with validating an XHTML document.  I created a test page to validate a document with the same contents, and received the same error.  Consider the instance document: 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<title>Virtual Library</title>
	</head>
	<body>
		<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
	</body>
</html>

I thought this document should validate using .NET.  The catch, though, is the missing "xmlns" attribute for the "html" element, which I found only by opening the document using the Internet Explorer Tools for Validating XML and Viewing XSLT Output. You can see in the XHTML 1.0 Recommendation that the xmlns attribute is required with a fixed value:

<!ATTLIST html %i18n; id ID #IMPLIED xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' >

Easy enough to fix, just add the xmlns declaration and the XmlValidatingReader is happy:


<!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">
	<head>
		<title>Virtual Library</title>
	</head>
	<body>
		<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
	</body>
</html>

The odd thing, though, is the error message that the XmlValidatingReader emits:

The 'x' character, hexadecimal value 0x78, cannot be included in a name.

What is the "x" character the error message refers to, and what logic is being evaluated internally?  Or is this just a badly written error message?  At any rate, a cool exercise in working with validation of documents on external schemas.

<Kirk />