June 2002 - Posts
Mimeo Lands $6.5 Million Financing
Here's a link to some quick coverage. Guess this means investors feel we've got ourselves a good product here. I know I certainly do! ;) Congratulations to my fellow employees who have worked hard and sacrificed during these tough times.
We're currently putting the finishing touches on our next-generation offering. I can't actually discuss the details yet, but suffice to say that we listened to what our users wanted, picked a few of the most requested features and that's what we're delivering (soon).
Never Give Up, Never Surrender! XHTML 1.1 DTD Saga Continued...
... I also get the same error when using the old DTD with the relative inclusion of DTDs fixed by my custom XmlResolver. 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. [BitWorking]
Interesting stuff. Here's the callstack leading up to the exception:
system.xml.dll!System.Xml.XmlTextReader::AddDefaultAttribute(System.Xml.Schema.SchemaAttDef attdef = {System.Xml.Schema.SchemaAttDef}) + 0x5d5 bytes
> system.xml.dll!System.Xml.XmlValidatingReader::AddDefaultAttribute(System.Xml.Schema.SchemaAttDef attdef = {System.Xml.Schema.SchemaAttDef}) + 0x1c bytes
system.xml.dll!System.Xml.Schema.Validator::Validate(System.Xml.ValidationType valType = None) + 0x3f7 bytes
system.xml.dll!System.Xml.XmlValidatingReader::ReadWithCollectTextToken() + 0x298 bytes
system.xml.dll!System.Xml.XmlValidatingReader::Read() + 0x2c bytes
system.xml.dll!System.Xml.XmlLoader::LoadCurrentNode() + 0xce bytes
system.xml.dll!System.Xml.XmlLoader::LoadChildren(System.Xml.XmlNode parent = {System.Xml.XmlElement}) + 0x3e bytes
system.xml.dll!System.Xml.XmlLoader::LoadElementNode() + 0xd2 bytes
system.xml.dll!System.Xml.XmlLoader::LoadCurrentNode() + 0x3d bytes
system.xml.dll!System.Xml.XmlLoader::LoadCurrentNode() + 0xf3 bytes
system.xml.dll!System.Xml.XmlLoader::LoadDocSequence(System.Xml.XmlDocument parentDoc = {System.Xml.XmlDocument}) + 0x47 bytes
system.xml.dll!System.Xml.XmlLoader::Load(System.Xml.XmlDocument doc = {System.Xml.XmlDocument}, System.Xml.XmlReader reader = {System.Xml.XmlValidatingReader}, bool preserveWhitespace = false) + 0xdc bytes
system.xml.dll!System.Xml.XmlDocument::Load(System.Xml.XmlReader reader = {System.Xml.XmlValidatingReader}) + 0x69 bytes
system.xml.dll!System.Xml.XmlDocument::LoadXml(String* xml = "<?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>") + 0x6d bytes
I've pinpointed the problem to this section of code within XmlNSAttributeTokenInfo::FixNSNames method.
<codeSnippet language="CIL">
IL_0129: ldc.i4.0
IL_012a: callvirt instance char [mscorlib]System.String::get_Chars(int32)
IL_012f: call bool System.Xml.XmlCharType::IsLetter(char)
IL_0134: brtrue.s IL_0152
IL_0136: ldstr "Xml_BadNameChar"
IL_013b: ldarg.0
IL_013c: ldfld string System.Xml.XmlNSAttributeTokenInfo::_Name
IL_0141: ldc.i4.0
IL_0142: callvirt instance char [mscorlib]System.String::get_Chars(int32)
IL_0147: call string[] System.Xml.XmlException::BuildCharExceptionStr(char)
IL_014c: newobj instance void System.Xml.XmlException::.ctor(string,
string[])
IL_0151: throw
</codeSnippet>
Now, the first thing I tried was adding an explicit namespace and guess what? It works! If you named the namespace and prefix all of your elements with the namespace name, the validation succeeds. For example, this works:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11-flat.dtd">
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:head>
<xhtml:title>Conforming XHTML 1.1 Template</xhtml:title>
</xhtml:head>
<xhtml:body>
</xhtml:body>
</xhtml:html>
Obviously this shouldn't be required, but maybe it will help you in the meantime. A temporary solution would be to pass all your XHTML 1.1 docs through an XSLT that looks for a default namespace declartion, change it to be a named namespace and prefix self/descendant elements (without an explicit namespace) with the name.
Now onto the real problem: it seems that the Schema.Validate method attempts to add a namespace attribute to any node that does not contain an explicit namespace declaration as it validates each node using XmlTextReader::AddDefaultAttribute. For whatever reason, XmlNSAttributeTokenInfo::FixNSNames is barfing on the validation of this added attribute claiming to only have found 'x'.
If I find any more details, I will post a follow up, but this certainly seems to be some sort of bug within the schema validation classes. I have a sneaking suspicion this is related to DTD only validated documents because I know I've used default namespaces successfully in XML Schema validated documents in the past.
Bit Again By Radio Title Encoding (Or Lack There Of)
Thanks to John St. Clair who pointed out that my RSS feed was trashed again. This time it was due to the '&' in the Don Box & Inclusion post. Even after I pointed this bug out the previous day, I fell victim to it again. *sigh* Is it too much to ask for proper encoding/decoding in the next Radio root update? Pretty please?
Creating a Design Surface Using Windows Forms and GDI+ in Microsoft .NET
There's an article just posted over on MSDN that shows how to create a graphics layout engine using GDI+ (via System.Drawing and child namespaces) and Windows Forms. The author uses the composite pattern to represent his graphical elements at runtime. To finish up, he also goes into describing how to print the model out via the System.Drawing.Printing namespace. A really good article on multiple levels.
Shared Source CLI (aka Rotor) Update
Shared Source CLI Update. "This beta refresh continues the Rotor team's commitment to our growing community and we are very excited to watch the community develop and the source base evolve in new directions. There have been more than 30,000 downloads of the Shared Source CLI to date. I encourage you to download the latest Shared Source CLI archive and explore the possibilities it presents. Follow the links from the download page to explore the growing community." [sellsbrothers.com: Windows Developer News]
Don Box: XML & Inclusion
XML & Inclusion. "I just read your 'Object vs. XML' post on the spout and I'd be pleased if you would allow me to respond with my own personal spoutlet. Here goes:" [sellsbrothers.com: Windows Developer News]
Personally, I'm in the XML Schema camp. I totally see the value in having loosely formed XML documents as well, but having a schema enables much richer integration with other environments.
The New Don Box Home Page
The New Don Box Home Page. I think this one will stick for a while. : ) [sellsbrothers.com: Windows Developer News]
Cool, sounds like Don and his team have a lot of good stuff cookin'.
XHTML 1.1. DTD Invalid Include Follow-Up
Following up on today's earlier discovery of what appeared to be the a bad URL to an include in the XHTML 1.1 DTD I came across this post in the W3 archives. Essentially it points out that relative DTD linking is not properly supported by some DTD parsers and it appears that .NET's is one of them. ;) From the looks of it, only the one module I discussed earlier today, xhtml11-model-1.mod, is declared relative to the XHTML DTD.
Therefore, to remedy this situation one would need to make a local copy of the XHTML 1.1 DTD, modify the relative reference, "xhtml11-model-1.mod", to be an absolute one, like so "http://www.w3.org/TR/xhtml11/DTD/xhtml11-model-1.mod" and then write a custom XmlResolver which detects requests for the W3 online version of the XHTML 1.1 DTD and redirects them to the local copy instead.
Google Labs: Keyboard Shortcuts Project
Saw a referrer link today that directed me to the Google Labs: Keyboard Shortcuts. It's pretty cool. Basically it enables a keyboard based approach to working your way through a standard Google search results page. Simple really. It's stuff you take for granted in your OS of choice, but that you don't usually find in a standard web UI these days... despite the fact that browsers have supported basic keyboard event handling since the 4.0 days.
System.Xml.XmlDocument and DTD's (Soon to be a mini-series). Andy McMullen pointed out to me via e-mail that I can write an XmlResolver all my own and fix the default XmlResolver's problems with relative directory names. There's even an MSDN article on creating custom resolvers. Way cool. My first experiment will be a little resolver that just passes all the work to the default resolver but lets me see exactly where .Net falls down on job when processing the XHTML 1.1 DTD. [BitWorking]
D'oh! I guess maybe Joe isn't subscribed to my RSS feed. I've talked about this before in response to his findings. I even offered an in depth solution to his problem earlier today. Guess I'll have to drop him a line and let him know. ;)
Update: I dropped him a line and it turns out he was hooked up at home, but not at work. He's tuned in now and hopefully he has some luck finding out what the proper URL is for that include is in the XHTML 1.1 DTD. I've looked, but haven't found it yet.
More Posts
Next page »