Re: MathML in HTML: syntax for hypertext links

On Fri, 3 Apr 2009, David Carlisle wrote:
> 
> MathML (1 and 2) has deferred to xlink for linking. The schema allowed 
> xlink, as a foreign namespaced attribute, on any element, and so to make 
> a link in MathML you could go
> 
> <mi xlink:type="simple" xlink:href="http:.....">text</mi>
> 
> In addition MathML has a "catch all" element, <maction>, for supporting 
> dynamic behaviour (in a way that in MathML 1 and 2 was intentionally 
> loosely defined in the spec, to allow for a certain amount of 
> implementer innovation). In particular in IE/MathPlayer you can go
> 
> <maction type="link" dsi:href="....">
>   arbitrary mathml content
> </action>
> 
> The Math WG is considering adding "native" support for linking in 
> MathML3. It has become painfully obvious that relying on an external 
> specification for linking is not ideal (Firefox 3 pulled support for 
> xlink, thus removing link support from all existing XHTML+MathML pages). 

My recommendation would be to not reference XLink normatively (the spec 
doesn't really define any implementation conformance criteria anyway) but 
to instead simply have xlink:href="" in MathML always mean a link.

That way the language is simplified (no need for xlink:type="", no 
confusion as to the meaning of the other XLink attributes, etc), while 
remaining backwards-compatible with previous implementations and without 
introducing yet more confusion into the issue.


> Also relying on (necessarily :-prefixed) xlink attributes for linking 
> will presumably cause problems for html5 integration.

XLink is supported by the HTML5 parser spec now, so this isn't a concern.


> Currently we are considering two possibilities.
> 
> 1) Allow href everywhere on all elements where it makes sense.
>    (The exact list would need to be determined exactly and listed in the
>    MathML3 spec.) This would allow
> 
>    <mn href="..">1</mn> 
>    as well as
>    <mrow href="..."><mi>a</mi><mo>+</mi><mi>b</mi></mrow>

I would encourage this approach except with the attribute named xlink:href 
(that is, "href" in the XLink namespace), so that there's no redundancy. 
Historically it has proved problematic when there are two attributes that 
mean the same thing, with different UAs getting different behaviour, 
serialisers getting confused, authors including both "just in case", the 
two attributes getting out of sync, etc.


> 2) Formalising the link behavior of maction. So a link would be made
>    with <maction type="link"> and the above two links would be coded as
> 
>    <maction type="link" href=".."><mn>1</mn></maction>
> 
>    <maction type="link" href="..."><mrow><mi>a</mi><mo>+</mi><mi>b</mi></mrow></maction>
> 
>    This is a perhaps smaller change to MathML, just adding the href
>    attribute to maction, but leads to considerably more verbose markup,
>    as demonstrated.

This doesn't seem better.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 1 May 2009 23:34:59 UTC