1 entry tagged hlink, xml, and xmtml2

Must ... ignore ... HLink!

The TAG rejects HLink, not many dead scream the headlines. Is this the end for XHTML 2?

What’s XHTML 2? It is the next step in the bridge from HTML 4.01 to the futuristic world of ‘pure’ XML documents. XLink is a recommendation from the W3C for how XML documents should express links to other resources. HLink is a new proposal from the XHTML committee for how XML documents should express links to other resources. In effect, they are saying that XLink is inadequate and they need to replace it. TAG have expressed an opinion that XLink should be used instead, presumably on the grounds that we don’t want to have two W3C recommendations for one and the same thing.

Can XLink replace the special-purpose linking attributes in HTML? I suppose we can imagine replacing img and object tags with something like

<object
    xlink:type="simple"
    xlink:show="embed"
    xlink:actuate="onLoad"
    xlink:href="myLogo.gif"
    width="400" height="300">
  My Logo
</object>

In principal the first three attributes (which would be the same for all images) can be given default values in the DTD. This is the approach used in SVG and MathML. The problem is that it prevents the XML document in question from being stand-alone. That is, the DTD must be downloaded and parsed before the document can be rendered. SVG fudges this; SVG documents often do not have DOCTYPEs, and SVG viewers in effect use a DTD compiled in to the software. All very messy.

There’s another problem: the HTML tag img also allows for URIs for the low-res version (lowsrc attribute), a long description (longdesc), and an client-side image-map (usemap). XHTML 2 also wants to add an href attribute to all elements (so any element in the document can be a link). I’m not sure that XLink defines xlink:show values for all of these. Even if it does, we cannot have more than one simple XLink link per element (since we can only have one xlink:href attribute). We could possibly follow the same system as XTM, with one child element per link:

<object style="width:400px; height:300px;">
  <source xlink:href="myLogo.gif"/>
  <usemap xlink:href="#logoMap"/>
  [My Logo]
</object>

(Here we are assuming that the DTD is used to generate default values for the other Xlink attributes—but do we really want to rely on all XML browsers being validating browsers...?)

The question is, will this work? Yes, if we are using a specialized XHTML-2-savvy browser (one which understands object and source, and knows how to interpret them). If the aim is to make XHTML 2 implementable using only XML + CSS 2 + XLink + XBase, without making XHTML a special case, then the answer is no.

The upshot of this is that, if the W3C want to make XHTML 2 just another XML format, displayable in a generic XML browser, then it looks like XLink is not quite right for the job. It may well be that I am missing something, and the above example can be reworked to work with XLink. It might be that lowsrc and longdesc are dumb features that no-one wants to carry over in to XHTML 2 anyway. But my naïve understanding of XLink and the nascent XHTML 2 suggests that the XHTML working group might have a point.

How is this going to end? Right now it looks to an outsider like the question is being discussed less in terms of technical issues like what XHTML’s goals are, and more in terms of committees and procedure and politics and such-like. We may end up with an XHTML 2 that requires a specialized XHTML 2 browser (requiring upgrades to existing browsers that recognize the XML namespaces or the DOCTYPE, or any of the other stupid heuristics in use today to distinguish different flavours of HTML). The dawn of XML as a fully-fledged hypertext mark-up language will delayed by a few more years...

I really should not be writing about this—I have plenty of other things to work on. I just find it difficult to tune out all these arguments about XHTML when that’s what I work with every day...