XMLmind XML Editor (XXE) is an - eh - XML editor. But as XHTML is
typically consumed as text/HTML, in practise it is also a HTML editor.
XHTML has always had a 'complicated' relationship to xml:lang. It seems
like everyone really wants to just use lang - or at least use just one
attribute (which would have had to be lang). But - either - in order to
"look good" - or - in order to use XML tooling (which is rumoured to not
support lang), it is customary to put upon oneselves the burdon of
adding both lang and xml:lang. This was recommended back in 1998 when
XHTML 1 was released. And it was also recommended by the polyglot HTML
draft (even if, in my heart, I did not want to require both attributes).
Context: As for tooling, then we see this in XXE itself; When working
with XInclude, it turns out that @lang is ignored - only xml:lang is
respected and counted. (I might write a separate RFE or BUG about that.)
The consequence being that if, via XInclude, you embed
<section lang="en" id="sect01" />
then the way XXE implements what XInclude calls 'language fixup' causes
the above element to be embedded as if the language property is unknown,
which (as of XXE 10.4) means that XXE adds xml:lang="" to the embedded
element:
<section xml:lang="" id="sect01" />
And, if it does not delete the lang attribute, we even get this:
<section xml:lang="" lang="en" id="sect01" />
Which means that XInclude has created a document which is invalid,
since, when both xml:lang and lang are used, they must be in agreement.
Clearly, this behavior is wrong - on many levels. (A separate bug about
this will probably be written.)
However, this message is not about how XInclude is implemented, but
about making it more convenient to apply xml:lang in XHTML and HTML
documents. And the (current) need to use xml:lang warrants that it
should be simpler.
I see two ways to make it simpler: EITHER add some form of automation:
When someone adds or edits the lang attribute, then xml:langs is added
and/or edited, automatically, in parallell. OR offer xml:lang in the
default list of attributes to select from. (Clearly I prefer the
automated variant.) AND a third option: Decrease the need to use
xml:lang.
So as of today, when authoring HTML or XHTML docuemnts, the lang
attribute is by default visible inside the Attribute editor. Just click
on the attribute name, and add the value. Whereas for xml:lang, you must
either manually type the name of the attribute before you can select it,
or you can change the defaults (on the fly) so that so called xml
attributes are also visible. (But this also makes xml:base and xml:space
visible. )
But the third alternative is what I prefer the most: Decrease the need
to use xml:lang. For instance, by changing the implementation of
XInclude so that lang is treated like xml:lang (and/or so that xml:lang
is kept in sync with lang).
Leif Halvard Silli
--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support