W3C home > Mailing lists > Public > www-html@w3.org > August 1999

Re: [Moderator Action] dir attribute in LINK

From: Chris Lilley <chris@w3.org>
Date: Mon, 09 Aug 1999 04:07:13 +0200
Message-ID: <37AE37D1.313CB483@w3.org>
To: Jonathan Rosenne <rosenne@qsm.co.il>
CC: "Martin J. Duerst" <duerst@w3.org>, Nir Dagan <nir@nirdagan.com>, www-html@w3.org, www-international@w3.org, Eli Marmor <marmor@Elmar.co.il>


Jonathan Rosenne wrote:
> 
> Eli Marmor's notes are following.
> 
> Jony
> 
> Martin J. Duerst wrote:
> 
> >At 05:20 99/08/05 -0400, Nir Dagan wrote:
> >>
> >> The HTML4.0 spec. [1] suggests that the dir attribute in LINK
> >> refers to the directionality of the linked resource.
> >> This is very different from the lang attribute that refers to the
> >> language of the title attribute (and hreflang refers to that
> >> of the linked resource)

The basic problem arrises because XML (and SGML) has a tree structured
system of elements, which have attributes; attributes themselves cannot
have attributes and cannot contain markup. This is a statement of the
obvious, practicallya FAQ, but even so the current problem appears to
stemfrom departing from the XML/SGML model. This is a legacy issue back
from when HTML was in its infancy.

The problems are:

1) The element which denotes the link should contain only information
regarding the link. Attributes on the link element refer to the
linked-to thing. 

2) Content is being hidden in attributes. In this case, the title
information. If more information (of a structured nature) is required
then XML/SGML structure (elements, and attributes) should be used to
encode it in preference to convention which simulate
attributes-on-attributes.

If title was made a child element of link, then the following desirable
results would happen:

a) the title could contain markup, such as emphasis, language changes
for subsections of the title, and so on.
b) attributes on the title element would naturally refer to the title
content. Thus, xml:lang on the title element would mean the language of
the title.
c) accessibility would be improved, since content was no longer being
hidden away in an attribute.
d) there would no longer be an ambiguity about whether language
(xml:lang) was referring to the link or to the title; no need to have a
keyed system (hreflang and dir refer to the language and directionality
of the link, but lang and (not specified) refer to the language and
directionality of the title.

Otherwise, to take this to its logical conclusion one would need to add
titledir, longdescdir, and longdesclang - all on the same element - thus
building a simulation of a tree structure by associating attributes with
one another - simulating attributes-of-attributes.

Compare these two models

1) <link lang="en" dir="rtl" hreflang="he" titledir="ltr"
longdescdir="ltr" longdesclang="fr" href="foo" title="bar"
longdesc="baz"/>

The parser is supposed to figure out that foo and baz are urls but bar
is content, and the application needs to know that lang and titledir are
a pair, and hreflang and dir are another pair, and so forth.

2) <link xlink:href="foo" xml:lang="he" i18n:dir="rtl">
     <title xml:lang="en" i18n:dir="ltr">bar</title>
     <longdesc xlink:href="baz" xml:lang="fr" i18n:dir="ltr"/>
     <desc xml:lang="fr" i18n:dir="ltr">baz <x>with markup</x>
even</desc>
   </link>

The parser figures out where the urls are by reference to the xlink
spec, and figures out what the language and directionality of each piece
of text is by looking at the element that it is on.

> >> 1. It would make more sense that dir would refer to the title
> >> attribute's directionality.
> >
> >Yes indeed, like DIR everywhere else.

Rather than arguing the bes way of pairing up attributes, it is better
to avoid the necessity altogether.

> It is FORBIDDEN to put instructions about how to display a page in
> another page that the linked page doesn't have a link (like in CSS)
> to. 

I agree with that also; though it can be useful to know some things
ahead of time, the linked to resource should also be completely labelled
itself.


> >> 2. In order to refer to directionality of linked resources
> >>  we need a new attribute, e.g., hrefdir
> >
> >i don't think this is needed. 'hreflang' and 'charset' are
> >very helpful because they help selecting the right link and
> >can provide information that may not be in the target document.
> >But my guess is that 'dir' is always used in the target document
> >(otherwise, it won't be readable), and therefore, it's not needed
> >on link.
> 
> Here I must disagree with Nir (and agree with Martin), because of
> the same reason I wrote above.

Again, regardless of whether the information  (which should certainly be
in the linked to document) should be duplicated somewhere in the link,
it is better to use xml structure (and to use xml:link for its intended
purpose, indicating the language of the element it is on) rather than
invent new naming schemes for grouping clusters of duplicated
attributes.

--
Chris
Received on Monday, 9 August 1999 00:45:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:39 GMT