|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Default Namespaces - why don't they apply to attributes?
I have been trying to understand the reasons why default namepaces do not apply to attributes but only elements. Section 5.2 of Namespaces in XML (http://www.w3.org/TR/1999/REC-xml-names-19990114/) states: A default namespace is considered to apply to the element where it is declared (if that element has no namespace prefix), and to all elements with no prefix within the content of that element. <snip> Note that default namespaces do not apply directly to attributes. I find this very cumbersome when writing XML documents that use namespaces. For example, I cannot do the following: <document xmlns="mynamespace"> <element attribute1="2" attribute4="test"> </element> </document> I am forced to do this: <document xmlns="mynamespace" xmlns:explicit="mynamespace"> <element explicit:attribute1="2" explicit:attribute4="test"> </element> </document> Surely attributes more often than not will belong to the same namespace as their element? Regards, Lisa
|
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








