[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

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

attribute default namespace
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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.