Re: Six Reasons Not to use XML Attributes
Whenever I hear discussions like this, a line from _Rocky Horror Picture Show_ always goes through my mind: âI didnât make him for *you*!â The primary use case for SGML-for-the-Web was to facilitate richly-marked-up documents, in the sense of artifacts by and for humans. The usefulness of XML for automated data interchange was noted (and had been observed with SGML as well) and was accommodated, but the primary use case was still human documents. Michael Kay was certainly not the first to note that mixed content and attributes are unnecessary, but the overwhelming utility of having a default rule of display content and throw away the rest prevailed. Consider the default processing rule for HTML browsers: when the ID attribute was globally added, it made it easy to change: <p><a name="frankNotForYou"></a><strong>Frank:</strong> I didnât make him for <em>you</em>!</p> to: <p id="frankNotForYou"><strong>Frank:</strong> I didnât make him for <em>you</em>!</p> Imagine if we had no attributes: a browser might know not to display the identifier in this: <p><a><name>frankNotForYou</name></a><strong>Frank:</strong> I didnât make him for <em>you</em>!</p> ... but switching to this: <p><id>frankNotForYou</id><strong>Frank:</strong> I didnât make him for <em>you</em>!</p> ... would have looked very strange in older browsers, and so adding any kind of new metadata would have been a non-starter. Although it is true that one personâs data is anotherâs metadata, there is still a presumption in XML default processing (e.g., the XSLT default templates) that content is visible and attributes are not. When working with machine interchange languages, this doesnât matter, but for human documents, it is a good principle to follow. ~Chris -- Chris Maden, text nerd <URL: http://crism.maden.org/ > âBe wary of great leaders. Hope that there are many, many small leaders.â â Pete Seeger
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
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