|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] element content vs. element attribute
Hi everyone, I've used XML twice now and in both cases I've ended up with nothing to markup except more tags and whitespace :). These languages are used to communicate relationships between external resources, not marked up text. The intent was to describe these relationships in a flexible but well defined format and XML offered a simple (and soon to be standard!) way of doing this. So far, so good. I've seen other examples of this type of "pure tag language" and noticed that some of them seem to force content into tags for no reason. My question is, given the "nothing to markup" scenario, which is more appropriate?, when is each more appropriate?, and why?: <blah>1234</blah> or <blah value="1234" /> In other words, when should data be contained by elements? Or conversely, when should data be an attribute of an element instead of contained by that element? I prefer the latter method, given an attributes ability to store CDATA without CDATA section delimiters. OSD and CDF use the former method for: <TITLE>Solitaire</TITLE> and I'm not sure why as: <TITLE value="Solitare" /> could serve the same purpose and is more inline with the rest of the language. Any general guidelines? Thanks! -Ray 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








