Re: [jats-list] <code> and @language documentation (1.1d1)

Subject: Re: [jats-list] <code> and @language documentation (1.1d1)
From: Alf Eaton <eaton.alf@xxxxxxxxx>
Date: Fri, 28 Feb 2014 20:49:14 +0000
On 28 February 2014 20:13, Debbie Lapeyre <dalapeyre@xxxxxxxxxxxxxxxx> wrote:
> On Feb 28, 2014, at 6:34 AM, Alf Eaton <eaton.alf@xxxxxxxxx> wrote:
>
>> I was looking at the documentation for the new <code> element[1], in
>> preparation for making use of it, and noticed a couple of oddities:
>>
>> Firstly, it seems that the @language attribute is intended for
>> conveying the language that the code is written in, but in the
>> examples, @code-type is used instead of @language. I would like to
>> suggest that the example is changed to use @language:
>>
>> <code language="xml" b&
>> rather than
>> <code code-type="xml" b&
>
>
> Interestingly, we had this argument inside Mulberry too.
> For myself, I am old-fashioned and maintain that "XML" is NOT
> a programming language.

XML may not be a programming language, but it is a markup language, so
I think "language" still makes sense here. The language attribute also
maps directly to HTML's recommendation of class="language-*" on a code
element[1] to denote the language of the code that's included. This is
used to tell syntax highlighters what to expect (which is the use case
that I'm working on here), when the HTML is rendered. If the code is
XSLT, then the class would be "language-xslt", and there wouldn't be
any need for an extra attribute to say that it's also XML, as that
would be implicit.

Alf

[1]
http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semant
ics.html#the-code-element

Current Thread