Re: Namespace prefixes for attributes

> ----- Original Message ----- 
> From: "Elliotte Rusty Harold" <elharo@metalab.unc.edu>
> To: <www-smil@w3.org>
> Sent: Thursday, November 16, 2000 8:23 PM
> Subject: [Moderator Action] Namespace prefixes for attributes
> 
> 
> > I'm still making my way through the SMIL 2.0 DTDs so I may be a little
> > off-base here, but I do think I've noticed something strange.
> > 
> > If the %SMIL.pfx; entity is defined as a non-empty string, and prefixing
> > is turned on, then the attributes have names like smil:transIn and
> > smil:transOut. If %SMIL.pfx; is defined as the empty string, then the
> > attributes have names like transIn and transOut. (The specific attribute
> > used is not important here.) This is what's intended, I think.
> > 
> > However what I suspect is unintentional is that for attributes, unlike
> > for elements, this changes what namespace the attributes are in.
> > Unprefixed attributes are never in any namespace, whether the default
> > namespace or the namespace of the element they belong to. So adding the
> > prefix here moves the attributes from no namespace at all to the
> > http://www.w3.org/TR/REC-smil/2000/SMIL20 namespace (or whatever URI has
> > been defined). That seems to me to be unexpected and unnecessary
> > behavior. 
> > 
> > Since these attributes are always placed on SMIL elements only, wouldn't
> > it be more consistent if they never had any prefixes at all and were
> > always in no namespace? 

Hi Eliot,

These attributes are _not_ always placed on SMIL elements only.  In
XHTML+SMIL for instance, many of these attributes can be placed on
HTML elements too.  The %SMIL.pfx; is just a service for other
profiles that want to explicitly add a namespace prefix to SMIL
elements and attributes that may appear on non-SMIL elements.  It is
not needed in a SMIL-only profile (that's why the prefix is defined as
an empty string in the SMIL 2.0 Language profile.  You are right when
you say that they are neither needed on SMIL attributes that can only
appear on SMIL elements.  This is indeed the case in the attributes
that are defined in the section modules; and these attributes do not
use the %SMIL.pfx;

I'm not sure about the "moving from no namespace to the SMIL
namespace" part, since I'm not a namespace expert.  But AFAIK, it is
up to the application to determine the namespace of a non-prefixed
attribute.  If that is true, the following two examples are more or
less equivalent:

  <smil20:par begin="5s"> or
  <smil20:par smil20:begin="5s">

In the first example, the application will assume that "begin" is in
the SMIL20 namespace, in the second this is explicitly encoded.  But I
could be wrong here.

In any event, thanks for reading the DTD drafts so carefully: we need
people like you to make a good spec!

-- Jacco

Received on Friday, 17 November 2000 05:16:17 UTC