W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2000

[Fwd: Namespace prefixes for attributes]

From: Philipp Hoschka <ph@w3.org>
Date: Thu, 23 Nov 2000 16:00:00 +0100
Message-ID: <3A1D30F0.A81DF6F9@w3.org>
To: xmlschema-dev@w3.org
CC: aaron.m.cohen@intel.com
Is there a way to detect the issue described below as 
"syntactic atrocity" by writing Schemas in a certain way ? 

This would mean that the Schema processor can find that an
attribute qualified with two different namespaces actually
has the same semantics, and thus shouldn't be used twice
on an element, i.e. any document that does this is invalid.

attached mail follows:

Just a note. What Jacco says is correct for SMIL 2.0 and the two forms
listed below _are_ equivalent in SMIL 2.0 because we define it to be that
way. The XML Schema for smil will define both local and global version of
the attributes that have general applicability (like begin) and so there is
a 'begin" that exists in the smil20 namespace, which is semantically and
syntactically identical to the "no namespace" version of begin defined on
the element.

Oddball question, what if both forms are allowed on an element? AFAIK, this
is legal syntax for the SMIL 2.0 language schema:
<smil xmlns="http://www.w3.org/2000/SMIL20/Language">
<smil:video begin="10s" smil20:begin="20s" .../>


And, BTW, so is this:
<smil xmlns="http://www.w3.org/2000/SMIL20/Language"
<smil:video begin="10s" smil20:begin="20s" basic:begin="30s".../>


We don't have semantics defined for these syntactic atrocities.


> -----Original Message-----
> From: J.R. van Ossenbruggen [mailto:Jacco.van.Ossenbruggen@cwi.nl]
> Sent: Friday, November 17, 2000 2:16 AM
> To: elharo@metalab.unc.edu; www-smil@w3.org
> Subject: 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 Thursday, 23 November 2000 10:03:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:49 UTC