[This is the first draft of CLink, a method for describing links in a CSS-based syntax. The Opera browser supports a set of properties which have different names, but offers similar functionality: -o-link, -o-link-source, and -o-replace]

CLink

This submission specifies a simple way to describe linking behavior in existing markup languages. Five properties borrowing the syntax from CSS are used to attach simple linking information to XML elements. The properties can describe simple linking behavior of XHTML, WML and Open eBook as well as other XML-based languages that share the same linking model.

Clink has not been designed to replace Xlink. There are three key differences between Clink and Xlink. First, Clink is a much simpler language not capable of describing the more advanced features of Xlink. Second, Clink does not require markup languages to change their syntax in order to describe linking behavior. Third, Xlink has some functionality which goes beyond Xlink, namely HTML's longdesc attribute and base element.

By describing linking behavior, Clink goes beyond style sheets which traditionally describe fonts, color, volume and other presentational information. Clink has much in common with the xx submission from yy and we suggest

Before describing the properties formally, some examples of use are given for existing markup languages.

HTML

img { replace: attr(src) }
img { link-longdesc: attr(longdesc) }
a { 
  link-set: attr(href);
  link-use: current;
}
base { link-base: attr(src) }

WML

In WML, the a element is a short form of the anchor element. For example, the following markup:

<anchor>follow me
  <go href="destination"/>
</anchor>

Is identical in behavior to:

<a href="destination">follow me</a>

The linking behavior of anchor and go can be described as:

anchor {
  link-use: next;
}
go {
  link-set: attr(href);
}

In, addition, WML shares with HTML the a and img elements:

img { replace: attr(src) }
a { 
  link-set: attr(href);
  link-use: current;
}

Some examples, the first from WML:

   <anchor>foobar
     <go href="http://www/foo">
   </anchor>

   go { set-link-source: attr(href); use-link-source: none }
   anchor { use-link-source: next }

Open eBook

The OEB package file describes an OEB publication by identifying all other files in the publication and by providing descriptive and access information about them.

item, reference {
  set-link-source: attr(href);
  use-link-source: current;
}

Fictional examples

Fictional example:

  <url>http://foo.bar</url>
  <title>foobar</title>

  url { set-link-source: content() }    
  title { use-link-source: current }

Generic search engine:

   <result href="http://...">
     <title>foobar</title>

   result { set-link-source: attr(href) }
   title { use-link-source: current }

Definition of properties

Property: link-set
Values: none | attr() | content()
Initial: none
Inherited: no
Description: This property sets the value of the 'link' variable which can later be used to generate a link through the 'opera-use-link-source' property.
Property: link-use
Values: none | previous | current | next
Initial: none
Inherited: no
Description: A value other than 'none' sets the element to be a source anchor and declares which value of the 'link' variable that should be used to find the URI: the previous, current or the next.
Property: link-base
Values: none | attr()
Initial: none
Inherited: no, but setting applies to the whole document
Description: This property sets the value of the 'link-base' variable which is combined with the 'link' variable to creat a full URI.
Property: replace
Values: none | attr(x)
Initial: none
Inherited: no
Description: This property declares the element to be replaced or not. If replaced, the attr() function is used to point to the attribute where the URI to the content can be found.