[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Re: Re: Default namespace for attributes?
  • From: "Mukul Gandhi" <gandhi.mukul@g...>
  • Date: Mon, 17 Jul 2006 14:18:27 +0530
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NL57gOKaJniYU9eXU2bVuXrj//fqyMF4Z3x6N9YBgkS8v03IbTGehU0HoYC2/7cQkVKjyD63/x9jIJI5NOuCyCeqZq1h7xVv8KVSZZSY7uKr7JucxHDAvl6sOZAHvyqsIPhIDh0RsRce8HvqU8re+JSNPuNKjLro5+ElzaLEouI=
  • In-reply-to: <e9dmkn$2og$1@s...>
  • References: <7870f82e0607151005nd7094fboc43dd7ecdc9b360a@m...> <e9dmkn$2og$1@s...>

Thanks to all who replied and getting my doubts cleared..

Regards,
Mukul

On 7/16/06, Dimitre Novatchev <dnovatchev@y...> wrote:
>
> "Mukul Gandhi" <gandhi.mukul@g...> wrote in message
> 7870f82e0607151005nd7094fboc43dd7ecdc9b360a@m...">news:7870f82e0607151005nd7094fboc43dd7ecdc9b360a@m......
> > The XML Namespaces Recommendation says that the default namespace
> > applies only to elements, and not to attribues
> > (http://www.w3.org/TR/REC-xml-names/#defaulting).
> >
> > i.e. an unprefixed attribute name will always be in the null namespace.
> >
> > I am curious to know why this is so?
>
>
> It seems to have some reason:
>
>  An attribute belongs to an element and its semantics must be defined as
> part of the semantics of the parent-element. Therefore, additionally there
> is no need to put the attribute in the same namespace as the one of its
> parent.
>
> On the other side, if we want to specify on a given element a "special"
> attribute that is not specific only to that element, but is "globally
> defined and owned", then having this attribute in some namespace will serve
> to give the attribute this semantics and be able to distinguish this
> attribute from the attributes that are ("local") specific only for the
> element or from other "global" attributes.
>
> This is how we generally specify such attributes as xml:lang, xml:id,
> xsi:type, ..., etc.
>
> Exactly because local attributes do not belong to any namespace and their
> names do not have prefixes, it is easy to distinguish the global attributes
> whenever they are specified on an element.
>
> So,  my understanding is that one goal of this part of the namespace spec
> was to provide a way of specifying attributes that would be easy to
> understand and that would allow special/global attributes to be seen easily,
> avoiding namespace-prefix clutter altogether.
>
>
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> Truly great madness cannot be achieved without significant intelligence.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member