Wow, Drew dug really deep into this problem and came up with some interesting stuff. Just go and read it 'cause I can't even begin to do it justice.
What can I say? I need a new thesaurus.
So .Net has some problems, along with some other tool sets, with following the rules for relative inclusions in DTDs. Drew was of course correct and I was able to create my own XmlResolver to fix the problem. BTW, the code sample in the MSDN article required some re-working for it to function properly. So now I am sure all the DTDs are loading correctly.
Upon further digging I found that there is a flat version of the XHTML 1.1 DTD that does not have the relative include problem. So I changed test.html to be:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11-flat.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conforming XHTML 1.1 Template</title>
</head>
<body>
</body>
</html>
Note the -flat.dtd. Now I run a very simple program using test.html:
And what do I get but the following error:
using System.Xml;
using System;
public class _ {
public static void Main(string[] args) {
try {
XmlDocument doc = new XmlDocument();
doc.Load("test.html");
XmlNodeReader reader = new XmlNodeReader(doc);
}
catch (System.Exception e) {
Console.WriteLine(e.Message);
}
}
}
I also get the same error when using the old DTD with the relative inclusion of DTDs fixed by my custom XmlResolver.
The 'x' character, hexadecimal value 0x78, cannot be included in a name.
I am a beaten man. I will drop back and punt and use XHTML 1.0 Strict, which I tested and it loads just perfectly fine, thank you.