OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: Default Namespaces - why don't they apply to attributes?

[ Lists Home | Date Index | Thread Index ]
  • From: Ronald Bourret <rpbourret@hotmail.com>
  • To: xml-dev@lists.xml.org
  • 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
> > 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 
>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 

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 

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS