Re: namespace-less atts in its:spans in test suite

I did a little more research and I think I see what's happening here. Any
attribute without a namespace prefix *is* in the empty namespace. As per
the XML spec, attributes do not inherit namespaces from their containing
elements, but as metadata qualifying their parents they should be
interpreted (semantically) as belonging to the same vocabulary as their
parent.

I found a good explanation
here<http://books.xmlschemata.org/relaxng/relax-CHP-11-SECT-1.html>:
"Elements and attributes receive slightly different namespace handling.
They are similar in that attribute names can be given a prefix to show that
they belong to a namespace. They get special treatment in that the default
namespace doesn't apply to them and any attributes that have no prefix are
considered to have no namespace URI. They sort of belong to the namespace
of their parent element but not exactly. The reason for this is that
attributes are supposed to provide metadata qualifying their parent element
rather than to contain actual information. Being qualifiers, it's often
considered that by default they belong to the same vocabulary as their
parent elements... Technically, however, these attributes are in no
namespace and have no namespace URI."

This interpretation of non-namespaced ITS attributes is built into the
schema contained in the spec. Appendix D.3, the RNG schema, contains an
entity called "its-local.nons.attributes", which contains all of the ITS
attributes, but explicitly in the null namespace. This entity is used by
only two elements: <its:span> and <its:locNote>.

So LibXML was correct in telling me that the attributes in <its:span> had
no namespace, but my own implementation was incorrect in not interpreting
these as ITS attributes anyway.

I think a section about the use of empty-namespaced ITS attributes should
be added to the spec. Sections 5.2.2 (for its:span) and in 8.3.2 (for
its:locNote) could then reference that. The wording could be taken in part
from the mention of the use of the empty namespace in section 5.2.1.

There are also currently no examples of using <its:span>, as far as I can
tell.

Any comments? Should I add these to the wiki?

Nathan


On Wed, Aug 21, 2013 at 11:30 PM, Yves Savourel <ysavourel@enlaso.com>wrote:

> Unprefixed attributes take their namespace from the element where they are
> declared:
> See the second paragraph of that section 6.2:
>
> "...the interpretation of unprefixed attributes is determined by the
> element on which they appear."
>
> So <its:span locQualityIssueComment='abc'> is ok.
>
> Hope this helps,
> -ys
>
>
> From: Nathan Glenn [mailto:garfieldnate@gmail.com]
> Sent: Thursday, August 22, 2013 7:56 AM
> To: public-i18n-its-ig@w3.org
> Subject: namespace-less atts in its:spans in test suite
>
> Hello again,
> I have a question about the usage of <its:span> in some of the ITS test
> suite XML files. For example, locqualityissue10xml.xml has
> "<its:span locQualityIssueComment="Senten...". I'm wondering if it is
> correct that locQualityIussueComment isn't prefixed with
> "its:". When processing this file, LibXML tells me that
> locQualityIssueComment is in the null namespace. Section 6.2 of the XML
> namespace specification seems to agree: "the namespace name for an
> unprefixed attribute name always has no value". Is this something
> that needs to be fixed in the test suite, or is there an error in my
> understanding? I count about 16 files that use unprefixed ITS
> attributes in an <its:span>.
>
> Nathan
>
>

Received on Thursday, 22 August 2013 19:04:48 UTC