W3C home > Mailing lists > Public > public-rif-wg@w3.org > June 2010

Re: [XML-Data] review of current draft

From: Bijan Parsia <bparsia@cs.man.ac.uk>
Date: Wed, 16 Jun 2010 11:36:06 +0100
Message-Id: <A411F943-D834-49F3-982E-EC64C4A00031@cs.man.ac.uk>
Cc: Christian De Sainte Marie <csma@fr.ibm.com>, RIF <public-rif-wg@w3.org>
To: Jos de Bruijn <jos.debruijn@gmail.com>
On 16 Jun 2010, at 09:04, Jos de Bruijn wrote:
>> I agree that we could limit ourselves to XML documents where all the
>> elements are in a namespace. That would be a restriction, but the  
>> use of
>> namespaces is gaining, if not already prevalent. But the default  
>> is that
>> attributes are not qualified, so, even if the elements are in a  
>> namespace,
>> the attribute will not, in most cases (e.g., attributes are not  
>> qualified,
>> in the RIF schemas).
>> The rec on namespaces consider that attributes belong, de facto,  
>> in the
>> na¨mespace of the owner element,

This is false. Unqualified attribute names are in the null namespace  
in all cases. (This is a syntactic matter.) Their *interpretation* is  
left to their host element (this is a semantic matter).


"A default namespace declaration applies to all unprefixed element  
names within its scope. Default namespace declarations do not apply  
directly to attribute names; the interpretation of unprefixed  
attributes is determined by the element on which they appear.
If there is a default namespace declaration in scope, the expanded  
name corresponding to an unprefixed element name has the URI of the  
default namespace as its namespace name. If there is no default  
namespace declaration in scope, the namespace name has no value. The  
namespace name for an unprefixed attribute name always has no value.  
In all cases, the local name is local part (which is of course the  
same as the unprefixed name itself)."

The second paragraph has the controlling text, "The namespace name  
for an unprefixed attribute name always has no value. "

>> but the XML schema spec does not say
>> anything about that AFAIK; so, we cannot just use the namespace of  
>> the owner
>> element.
>> And the lexical space of rif:iri is that of absolute IRIs, so, we  
>> cannot
>> have a rif:iri with only a local name :-(
>> That is why I included xs:NCName. But if somebody has a better  
>> solution...
>> One question is: is it possible, for an element, to have two  
>> attributes with
>> the same local name, one being in the same namespace as the  
>> element, the
>> other being in no namespace?


"This constraint is equivalent to requiring that no element have two  
attributes with the same expanded name."

In your scenario, as long as the element had a non null namespace  
this would be legal.
	<e:foo xmlns:e="http://ex.org" bar="1" e:bar="1"/>

is namespace well formed

	<foo xmlns="http://ex.org" bar="1" bar="1"/>

Is not.

	<foo xmlns="http://ex.org" xmlns:e="http://ex.org" bar="1"/>
the XPath
has one answer whereas:
is empty.

>> I see nothing that would forbid that case, but
>> if there is, then we could follow the namespace rec and associate
>> namespace-less attributes with the namespace of the owner element.
> I believe it is not forbidden.

This tactic will result in inconsistent processing between RIF  
systems and those which conform to XML Namespaces.

I don't say it's "forbidden" because you could, in theory, impose  
this processing as an application level constraint. But you will not  
roundtrip properly and you will treat as equivalent documents which  
are, by the namespace rec, distinct.

Hope this helps.

Received on Wednesday, 16 June 2010 10:35:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:47:58 UTC