[tei-council] Attributes in no namespace
Martin Holmes
mholmes at uvic.ca
Sun Dec 29 17:37:30 EST 2013
Hi all,
Here's a Christmas conundrum. This section of the Guidelines:
<http://www.tei-c.org/release/doc/tei-p5-doc/en/html/TD.html#TDeg>
contains an egXML whose purpose is to illustrate that it is possible to
use the TEI @rend attribute to include styling information for example
elements in the Examples namespace:
<egXML xmlns="http://www.tei-c.org/ns/Examples"
xmlns:tei="http://www.tei-c.org/ns/1.0">
<div>
<head>A slide about <gi>egXML</gi></head>
<list>
<item><gi>egXML</gi> can be used to give XML examples in the TEI
Examples namespace</item>
<item>Attributes values for<att>valid</att>:
<list tei:rend="collapsed">
<item><val tei:rend="green">true</val>: intended to be fully
valid</item>
<item><val tei:rend="amber">feasible</val>: valid if missing nodes
provided</item>
<item><val tei:rend="red">false</val>: not intended to be
valid</item>
</list>
</item>
<item>The<att>rend</att> attribute in the TEI namespace can be
used for recording how parts of the example was rendered.</item>
</list>
</div>
</egXML>
Here, the "@tei:rend" attribute is intended to be an attribute in the
TEI namespace, not the Examples namespace, and thus to be interpreted
for rendering purposes rather than serialized as part of the example.
This strikes me as wrong. The @rend attribute we use in TEI is NOT in
the TEI namespace; it's in the empty namespace. (Unprefixed attributes
are not in the namespace of their parent elements.) In order for this to
work, wouldn't we have to declare a special version of @rend which was
explicitly in the TEI namespace, with the same semantics as the regular
@rend, and use that? Because in terms of XML, these are two completely
different attributes:
<p xmlns:tei="http://www.tei-c.org/ns/1.0"
rend="blue"
tei:rend="red">
Blue or red?
</p>
The regular @rend is not in any namespace at all, according to the XML
specification -- and incidentally also according to the RelaxNG
specification, which I went and looked at; there, we're told that "A
foreign attribute is an attribute with a name whose namespace URI is
neither the empty string nor the RELAX NG namespace URI"
(<http://relaxng.org/spec-20011203.html#full-syntax>) which means that
our "TEI" attributes are defined with the empty string namespace, and if
they were not, they would be "foreign" attributes).
So I contend that this @tei:rend attribute is not our own TEI @rend
attribute, but a foreign attribute; and if we actually wanted to use the
TEI attribute, we would have to do this:
<egXML xmlns="http://www.tei-c.org/ns/Examples"
xmlns:realTEI=""> ... <val realTEI:rend="red"...>...
But that in fact THIS cannot work either, because the @rend attribute
used in the context of <egXML> elements in the Examples namespace is
ALSO in the empty string namespace, and therefore they are no different
from each other.
In other words, it is impossible to do what we set out to do in this
example, according to the rules of XML.
Am I wrong?
Cheers,
Martin
More information about the tei-council
mailing list