miscoranda: by Sean B. Palmer

GRDDL for XHTML Schemata Associations

For validation and as an editor hint in emacs's nxml-mode, I use a little RELAX NG Compact schema called xhtml.rnc which allows a subset of XHTML 1.0 Strict. So any documents that I write conforming to it should also hopefully be valid XHTML 1.0 Strict. But how do I make the association between an instance document and this schema formal?

The obvious choice would be to use the schema as a value of the profile attribute, which is designed as either a global unique name for dispatch of arbitrary facilities, or as a namespace for @rel and @rev. My use of it here would be for the former purpose:

<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://inamidst.com/proj/quality/xhtml.rnc">
   [...]

Sadly, though, this conflicts with languages which provide facilities under the latter purpose, so in other words if I use the profile attribute for my own devices, I won't be able to use it when some other language comes along that needs it. One such language that may well be very popular in the future, and is already specified, is GRDDL. But GRDDL is special in that it is itself a generalised mechanism for allowing arbitrary extra structure to be added to HTML, in such a way as to be clearly authorised by the creator of the document.

So it would be possible to use GRDDL to provide this schema hint, as long as we used the GRDDL mechanism properly. Here's what I envisage:

<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2003/g/data-view">
<link rel="transformation" href="http://example.org/xhtml/transform" />
<link rel="schema" href="http://example.org/xhtml/schema" />

This is okay because HTML 4.01 says that "Authors may wish to define additional link types not described in this specification. If they do so, they should use a profile to cite the conventions used to define the link types.", which means that it's up to GRDDL to define what rel="schema" means, but GRDDL doesn't seem to mind as long as you obey its rel="transformation" way of doing things. So the definition for rel="schema" comes from the output of the transformation. The transform URI here could be used as a globally unique value itself, if you know the rel="schema" convention that it formalises.

For more information on this topic, see the #swig chat that I had with Dan Connolly as to whether it was valid to use rel attribute values not defined by GRDDL for your own use even when using the GRDDL profile.

by Sean B. Palmer, at 2006-04-25 16:04:56. Comment?

User-Agent Abuse · Antikythera Mechanism in Python

Sean B. Palmer