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

Hi Nathan,

thanks for looking deeper into this - I think Yves has pointed to the 
section that makes things clear, but feel free to add further proposed 
clarifications to the wiki. For your implementation, it may be simple to 
have a check like "if the element processed is one of these (list of 
names including its:span, its:locNote) then process the following ITS 
attributes in no namespace: ..."
Note, btw., that you have no namespace attributes also in standoff 
elements (its:provenanceRecord and its:locQualityIssue). But the set of 
no namespace attributes differ. Hence it is hard to have a general rule 
about this - rather implement it per data category and local / global 
implementation.

Best,

Felix

Am 22.08.13 21:04, schrieb Nathan Glenn:
> 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 
> <mailto: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
>     <mailto:garfieldnate@gmail.com>]
>     Sent: Thursday, August 22, 2013 7:56 AM
>     To: public-i18n-its-ig@w3.org <mailto: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 Monday, 26 August 2013 08:24:45 UTC