|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Newbie Q
>Is there a formal rule for the use of Atrributes vs Elements? The >assumption I am going on (per The XML Primer) is that Attributes are >best used to communicate information to the browser/application, and >Elements are best used for actual Data. Is this a valid assumption? > >In an EDI transaction, I was going to put the Header and Trailer >information in attributes, with the actual Detail Segments as >Elements... > >Any thoughts? Definitely see Robin Cover's page on this [cited by another responder]. It seems to me that issue of Attributes vs Elements becomes trickier as the thing you are marking up becomes more data-like and less document-like. The value of attributes are technically markup rather than content (at least by my reading of the spec) so the clearer the distinction is between what should be content and what should be markup, the clearer the attribute vs element issue is. This isn't too bad when you are marking up already existing content but it gets progressively worse as the markup language is used less and less for 'marking up' and more and more for other things. As my paper at SGML/XML Asia Pacific (or is it XML Asia now?) will discuss, one is always drawing the line between content and markup on an application by application basis. Content generally contains (or perhaps *is*) markup that's not XML. Consider spaces between words. They are a form of (non-XML) markup. They are also a presentational style. In some applications (such as corpus linguistics) word boundaries are marked up and it is a stylesheet issue to display the spaces. The moral is that even an important distinction like markup vs content vs presentation depends on the application. James -- James Tauber / jtauber@j... http://www.jtauber.com/ Lecturer and Associate Researcher Electronic Commerce Network ( http://www.xmlinfo.com/ Curtin Business School ( http://www.xmlsoftware.com/ Perth, Western Australia ( http://www.schema.net/ xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
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








