A pox on validation’s house

I would dearly love to gather up everyone who has ever attempted to teach English composition to anyone now involved in XHMTL/XML/DTD spec writing, so that I could give them all a medal for their efforts, and then shoot them all for their miserable failure to achieve anything resembling results.

In order to make a page including the TrackBack RDF data validate, you “simply” need to write a new DTD, along the lines of:


<!ENTITY % xhtml_trackback.mod
PUBLIC "-//Movable Type//ELEMENTS XHTML TrackBack RDF 1.0//EN"
"http://philringnalda.com/scratchpad/xhtml_trackback.mod" >
%xhtml_trackback.mod;
<!ENTITY % xhtml11.dtd
PUBLIC "-//W3C//XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
%xhtml11.dtd;

and then just write xhtml_trackback.mod, a module that “brings in” the RDF and DC namespaces (in some incomprehensible and unspecified way), and then defines the rdf:RDF element and its content, the rdf:Description element and its attributes, and attaches them to the XHTML content model (in Misc.extra, which says “put it anywhere you like”). Simple as falling off the earth. The W3C validator doesn’t help much when defining your own DTD (it gives line numbers for errors in the DTD, but presents them as though they were errors in the XHTML, so you get errors in the middle of blank lines), but the WDG validator will tell you where in your DTD you screwed up, though not exactly how. First time I’ve ever had a validator tell me that it reached its maximum error count, and couldn’t stand to go on anymore.

If someone else wants to follow me down the garden path, here are some of the bookmarks that didn’t explain things well enough for me to figure it out:

(I was planning on editing this, to tone down the rhetoric a bit, but after I discovered that Bloglet gets draft posts from blogger.getRecentPosts I decided to just publish it. After all, I’ve spent almost an entire day chasing my tail on this, without any results, so I think I’m entitled to be a little crabby. After all, XHTML modularization is over a year old, and RDF is over three years old: that seems like enough time for someone to come up with a DTD skeleton that would let a content producer just replace a few element and attribute names, or better yet a DTD wizard that would ask what elements you need to use, what attributes you’ll give them, and where in your XHTML you want to put them, and then spit out a working, valid DTD. Not as much fun as arguing a triple-abstraction in a mailing list thread that has gone through four subject changes, I’m sure, but every now and then you need to actually do something.

13 Comments

Comment by Dorothea Salo #
2002-06-30 07:48:00

Yeah, well, *part* of the problem is that RDF is predicated on namespaces, and DTDs and namespaces do not play well together.

This problem is so well-known that markup geeks mostly don’t bother to talk about it any more. Depressing.

Maybe you could talk Burningbird into helping you with this. She’s more of an RDF geek than I am.

 
Comment by Phil Ringnalda #
2002-06-30 15:04:21

Unless I’m still missing something, the problem seems to be that the code that all the validators run makes assumptions based on the mime type, and if you serve up text/html that doesn’t have one of the official (X)HTML doctypes, it treats it as SGML rather than XML, and the XHTML DTD isn’t written to pass as SGML, and so it looks like you can extended and subset XHTML 1.1 all you want, but if you want it to validate, you’ll need to write your own validator. I’d be happy to hear that I’m wrong, but for now I think I’ll quit wasting my time on this, since the only difference between XHTML with invalid RDF in it and valid modularized XHTML+RDF would be the sight of that pretty ”Congratulations, no errors found!” from the validator.

Gotta love the fact that I made the Daypop Top 40 (for a little while, anyway, on a slow day) by spending most of a weekend discovering that I couldn’t do something.

 
Comment by Dorothea Salo #
2002-07-01 12:06:50

That sounds about right, actually.

The fundamental problem here is that the idea of a document containing more than one validatable content model is brand-spanking-new to the SGML/XML world. (Okay, barring bizarrerie such as Architectural Forms.) Nobody is really sure how to validate such a beast yet. Modular XHTML is a first stab at the problem, but there’s a *ways* to go yet.

 
Comment by Phil Ringnalda #
2002-07-01 12:24:51

Well, I’m not noted for my patience (Modular XHTML is over a year old! Whadda you mean it won’t validate yet!). I’m already two proposals past this, now: I went through document.write pretty quickly, and now I think the way to go is to completely redo it as a separate file, with a link tag in the head that either a program or a bookmarklet can use to discover where the RDF lives: just have to convince Ben.

 
Comment by Terje Bless #
2002-07-29 12:03:41

Phil Ringnalda: ”…the problem seems to be that the code that all the validators run makes assumptions based on the mime type, and if you serve up text/html that doesn’t have one of the official (X)HTML doctypes, it treats it as SGML rather than XML…”

Nope. ”all the Validators” jump through hoops to DWIM on the issue of XML vs. SGML in the face of inaccurate MIME types. The issue with the Validators is more that there is no defined way to actually include RDF in (X)HTML; at least not in a way that would make sense to a DTD-based Validator. Maybe when Schema Validation comes of age…

”The W3C validator doesn’t help much when defining your own DTD (it gives line numbers for errors in the DTD, but presents them as though they were errors in the XHTML, so you get errors in the middle of blank lines)”

Yes, this is a known limitation of the W3C Markup Validator. It’s intended more to check the HTML itself rather then the DTDs it includes. Mostly on the assumption that if you’re writing a DTD you don’t need/want a friendly web based frontend for your XML/SGML Parser. If you want the W3C Markup Validator to support this mode, www-validator@w3.org is –>that way…

”First time I’ve ever had a validator tell me that it reached its maximum error count, and couldn’t stand to go on anymore.”

The maximum number of errors is configurable and the WDG thought it better to limit the number of errors displayed (because after the first few the rest are likely to be a result of earlier errors). The W3C Markup Validator will show you all errors.

 
Comment by ralph #
2002-08-09 16:16:40

As I was reading Phil’s original post above, my initial thought was ”why not just move the RDF out into a separate file and use the LINK tag to point Trackback to that?” Of course, Phil was a step ahead of me, as I see he’s already gotten there and probably a little beyond. Unfortunately, when I clicked on the link to convince Ben, it was broken….

 
Trackback by TrackBack Development #
2002-06-30 01:28:41

TrackBack and XHTML Validation

One of the issues with TrackBack currently is that the RDF that TrackBack inserts into pages breaks XHTML validation. Now,

 
Trackback by CraigSchamp.org #
2002-06-30 09:30:53

Incoming!

Highlighting an example of TrackBack in action on my blog, and re-thinking the XHTML/RDF validation issue.

 
Trackback by robertrainwater.com #
2002-06-30 16:14:38

XHTML Validation and TalkBack

Ben has posted an article asking for some suggestions for the XHTML validation problem using the TalkBack RDF data from

 
Trackback by In My Experience #
2002-07-30 21:12:05

Will there ever be RSS/RDF in (X)HTML and have it validate?

There have been complaints/worries that MovableType’s RDF data inserted into HTML files makes the HTML un-validatable (that can’t be a real word). Someone else had the idea to put RSS in XHTML for ’one file

 
Trackback by philringnalda.com #
2002-08-22 08:13:07

Validate this!

You know how when you were a kid, and you had to clean your room on a sunny day when

 
Trackback by Antipixel #
2002-08-22 17:31:16

TrackBack and Validation: Getting It Straight

Tomas made a good comment in response to my last post. I said TrackBack “seems to break XHTML validation” to

 
Trackback by protocol7 #
2003-01-11 17:26:36

Valid trackback RDF in XHTML

Moveable type can automatically ping other sites that I reference in my posts with their technology called trackback. To do

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.