|
[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?
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








