W3C home > Mailing lists > Public > www-rdf-interest@w3.org > March 2001

RE: Attributes and Namespaces.

From: Lee Jonas <lee.jonas@cakehouse.co.uk>
Date: Fri, 30 Mar 2001 13:38:17 +0100
Message-ID: <51ED29F31E20D411AAFD00105A4CD7A770DC@zingiber.cakehouse.co.uk>
To: "'Janne Saarela'" <janne.saarela@profium.com>, "'www-rdf-interest@w3.org'" <www-rdf-interest@w3.org>
Consider a legal DTD document:

<!ELEMENT my:docel (my:element1, my:element2) >
<!ATTLIST my:docel 
      xmlns:my    CDATA       #FIXED "http://some-namespace/"

<!ELEMENT my:element1 EMPTY >
<!ATTLIST my:element1 
      about       CDATA       #FIXED "this is an attr that belongs to
my:element1's 'per-element' space"

<!ELEMENT my:element2 EMPTY >
<!ATTLIST my:element2 
      about       CDATA       #FIXED "different attr that belongs to
my:element2's 'per-element' space"

Now the XML:
<!DOCTYPE my:docel SYSTEM "...">
<my:docel xmlns:my="http://some-namespace">
      <my:element1 about="this is an attr that belongs to my:element1's
'per-element' space"/>
      <my:element2 about="different attr that belongs to my:element2's
'per-element' space"/>

'about' on 'my:element1' is clearly a different attribute than 'about' on

You cannot interpret them both as belonging to a namespace bound to the 'my'
prefix in an XML doc, as that would make them both instances of the same
attribute in 'global' space, which would clearly make the DTD fragment above

Even if this behaviour were common practise, it is inconsistent with XML
validation via DTDs and hence, IMHO, it is just plain wrong.  Unqualified
attributes should be in 'per-element' space, i.e. their scope is the element
type they adorn only.  

The RDF spec's treatment of XML namespaces is sloppy.  There are a few
issues in the RDF issues list because of it.  Let's hope that the next one
conforms to other W3C recommendations more precisely.



-----Original Message-----
From: Janne Saarela [mailto:janne.saarela@profium.com]
Sent: 29 March 2001 08:09
To: Aaron Swartz
Cc: Hart, Lewis; RDF Interest
Subject: Re: Attributes and Namespaces.

> > <rdf:Description about="http://www.w3.org">
> >        Publisher="World Wide Web Consortium"
> >        Title="W3C Home Page"
> >        Date="1998-10-03T02:27"/>
> Yes, it does. In the second example, no triples should result.
> > If not, why not?
> I don't know the exact reasoning, but I've gathered that there were
> applications that required this to work this way. Perhaps someone with
> history than I can explain what those were.

Common practice appears to be to associate unqualified attributes
with the namespace of the element where they appear.

In the previous example, about, Publisher, Title, and Date
would all be associated with the RDF namespace.



[1] http://www.w3.org/TR/REC-rdf-syntax/#reservedURI
[2] http://www.w3.org/TR/xmlschema-formal/
Janne Saarela <janne.saarela@profium.com>
Profium (former Pro Solutions), Tekniikantie 12, FIN-02150 Espoo
Tel. +358 (0)9 25 172 172 Fax. +358 (0)9 25 172 200
Mob. +358 (0)40 508 4767
Internet: http://www.profium.com
Received on Friday, 30 March 2001 07:37:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:07:35 UTC