[tei-council] Attributes in no namespace
Martin Holmes
mholmes at uvic.ca
Mon Dec 30 20:54:03 EST 2013
On 13-12-30 03:06 PM, Syd Bauman wrote:
> Quick thoughts on this:
>
> * Martin is correct, the tei:rend= attributes shown in the 2nd
> example of 22.4.2 do not match the "normal" TEI rend= attribute
> (which is in no namespace), and thus do not do what the prose says
> they do. (What the prose says does apply to elements, though.)
>
> * I'm inclined to just ditch the example and associated prose.
That's what my ticket suggests:
<https://sourceforge.net/p/tei/bugs/631/>
>
> * Martin fears our inability to distinguish attributes, a fear I
> think is a bit silly. It's certainly not as easy as saying
> "@tei:end" and "@svg:end", but "tei:*/@end" and "svg:*/@end" work
> just as well. (Not to mention the more precise "tei:kinesic/@end"
> and "svg:subImageRef/@end".) Yes, if you've actually matched the
> "@end", i.e. the attribute of unknown origin is the context node,
> then you'll have to test namespace-uri(). Not pretty, but certainly
> not worth railing about much.
I have two distinct concerns with this, neither of which (obviously) I
think is silly, but perhaps they may be. The first is slightly abstract:
although it's easy to distinguish between identical attributes based on
the namespace of their parent node in e.g. XPath, the fact is that they
are technically the same attribute in the context of a
multiple-namespace document, and their definitions are in conflict.
The second is we cannot import only an attribute from another
specification to use as a child of our own elements (unless it happens
to be explicitly defined with a namespace, such as e.g. @xlink:href); we
can only import elements which carry it. That means we were unable to
import and use the SVG @points attribute (for example) into TEI; we had
to create our own mirror of it, with the slight risk that their
definitions might diverge in the future.
@[xlink:]href is a good example of this. The @href attribute we
encounter every day in XHTML is an empty-namespace attribute which is
not the same as the @xlink:href attribute which was explicitly designed
(I presume) so that it could be imported into other schemas. So SVG (for
instance) uses @xlink:href because it can; it could not use @href from
XHTML, any more than we were able to use XHTML's @style attribute, even
though we might well want to.
This seems to me to be a fundamental design flaw, and I simply don't
understand it. Why did the designers of XML decide that attributes don't
inherit the namespace of their parent elements? It seems perverse, and
is certainly unintuitive -- on a couple of occasions I've tried to
explain it to pretty knowledgeable XML types and been met with frank
disbelief. This particular bit of the TEI Guidelines shows that even
authors of bits of the Guidelines have not quite understood it, or
forgotten it, or found its implications confusing.
Cheers,
Martin
More information about the tei-council
mailing list