DALI examples and mixed content
Mark Taylor
M.B.Taylor at bristol.ac.uk
Fri May 20 12:08:30 CEST 2016
Dear DALI enthusiasts,
here's another DALI examples question: what about non-CDATA content
of RDFa property elements?
Labelling an example is typically done by adding the @property="name"
attribute to the relevant element:
<h2 property="name">Calculate sum</h2>
All the examples of examples in the DALI and TAP documents look
like that; plain text content of elements that have @property
attributes.
But you could imagine wanting to label an example in HTML something
like this:
<h2 property="name">Calculate chi<sup>2</sup></h2>
which is not forbidden by the current DALI-examples text.
Clients are probably expecting plain text here, and inclusion of
markup may confuse them (at least, that's what happened when I
first wrote a client for this).
I came across something like this in Markus's examples last year
(private email exchange 12 May 2015), and we ended up by using
the RDFa @content attribute, which enables you to provide an
explicit override for the element content in an attribute, like
this:
<h2 property="name"
content="Calculate chi-squared">Calculate chi<sup>2</sup></h2>
That works nicely, and it's sitting in topcat's client code.
However, it is actually illegal content as far as DALI-examples
goes, since DALI-examples mandates RDFa Lite, and @content is a feature
from RDFa (not-Lite). RDFa Lite forbids use of non-Lite RDFa features.
Although my conscience lets me live with it sitting in topcat,
I can't really write it into taplint.
Since the mixed-content thing is bound to come up in examples in
the future, this ought to be mentioned explicitly in the DALI-examples
document. It doesn't necessarily have to be normative, but at the
least there should be a note flagging this up as a potential issue
for implementers. I can think of a few possibities:
1. Just warn example consumers that they might have to deal with
mixed content of property elements, and warn authors that
mixed content may be rendered unpredictably
2. Mandate that the content of any element with an RDFa @property
tag must be plain text
3. Specify rules for making sense of mixed content of elements with
RDFa @property tags (e.g. markup can be ignored and plain text
content must be run together)
4. Allow use of the RDFa @content tag, and mandate it in the
case of content that would otherwise be mixed.
I kind of like 4, but it complicates the standard a bit since we
can no longer say it's just RDFa Lite. It would have to say something
like RDFa Lite + @content. I could live with any of the others.
Comments?
Mark
--
Mark Taylor Astronomical Programmer Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-9288776 http://www.star.bris.ac.uk/~mbt/
More information about the dal
mailing list