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

  • From: Ronald Bourret <rpbourret@h...>
  • To: xml-dev@l...
  • Date: Thu, 20 Jul 2000 22:38:03 +0000 (CEST)

Lisa Retief wrote:

> > By the way, I would be really curious to see any applications for which
> > knowing of an attribute is "in" a namespace -- as opposed simply
>identifying
> > the attribute -- is important. I can't think of any, but maybe I'm just
> > unimaginative.
> >
>
>I think that the application I am developing has a need for this. We 
>receive
>XML data from a number of different sources, and then run it through a
>transformation process (XSLT and some other stuff). Part of this process
>adds our own custom attributes to elements in the XML documents, but there
>is not way to ensure uniqueness of attribute names without using 
>namespaces.

Actually, a better solution would be to prefix *your* attributes. This 
uniquely identifies them as being in your namespace, and has the advantage 
that you could then work with XML documents that use namespaces and with XML 
documents that don't use namespaces.

For example, if you started with the XML document

   <foo bar="baz" />

you would transform this to:

   <foo bar="baz" yourns:yourattr="yourvalue" />

This doesn't change the meaning of the original elements or attributes and 
still ensures that all attributes are readily identifiable. To me, this is a 
perfect example of why namespaces are needed for some attributes but not for 
others.

-- Ron Bourret
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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