element content vs. element attribute
Ray Waldin
rwaldin at pacbell.net
Sun Dec 21 03:22:53 GMT 1997
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 at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list