Re: Hypermedia - Why

On 26/07/2012 13:28, Rushforth, Peter wrote:
> I have seen you tell others on public lists that xlink is wrong, but
> I didn't challenge you as to why you think it's wrong


One can quibble about the details of the design of any language but the
one thing I think that xlink in the end (not actually in its initial
drafts) got wrong is using fixed attribute names.

XML isn't in itself a language, it is a framework for designing
languages and as such it goes to some lengths to avoid reserving any
keywords and forcing any linguistic or syntactic choices on languages
specified in that framework.

So the main thing wrong with xlink:href is nothing really to do with any
aspect of its definition in the xlink spec. It is simply that it has to
be an attribute and it has to be called *:href.

This means that it can not be used if the language designers want to
call it something else (it would look pretty odd to have an attribute
with ascii characters if all your element and attribute names are in
Chinese) or, closer to home, if all your attribute names did not have a
colon. It also means (since only one such name is allocated) that you
can not have two such attributes on the same element.

As I mentioned before, these reasons alone were the reasons for not
using xlink on languages such as xhtml2 being developed at the time.

The xml: namespace is of course an exception to the general principle
that XML does not reserve names xml:space and xml:lang are already
allocated in the core XML spec.

But the default position for _any_ suggestion to increase the number of
pre-defined names should be not to do it. The bar for adding names to
the xml namespace should be incredibly high. The xml: namespace allowed
a few small exceptions to the general principle that names should not be
reserved. It isn't clear that that was ever the best part of the XML
design, and it certainly shouldn't be taken as a precedent.

Basically what you what to do is be able to say that some attributes are
"hypertext links". XSD isn't my favourite schema language as a rule, but
it is the standard way to annotate XML structures with types.
If you want to say attribute foo="example.com" is a link of a certain
type, you should define a schema type representing that and then apply
that schema to the instance. (Or if not XSD specify a different
annotation mechanism). What you should not do is say "if you want to
make a link the attribute has to have fixed name xxxxx".

David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Received on Thursday, 26 July 2012 12:50:58 UTC