Embedding Content as Element Content or As An Attribute Value

Michael Kay M.H.Kay at eng.icl.co.uk
Fri Jan 9 13:57:29 GMT 1998

>Ray Waldin wrote:
>> Of all the answers I've received, the ones referring me to SGML
publications were the
>> most intimidating

Marcus Carr replied:
>The question was related to a philosophical issue that has been hashed out
>people for ten years now, and that applies directly to XML as well.

I think Marcus is wrong. The domain of application of SGML is different from
the domain
of application of XML, and the distinction between attributes and content
which made sense
in the SGML world is extremely perplexing to those with a background in data
and data structure design in other domains, who are legitimate members of
the XML
community. Philosophically - at least in terms of any ontological system I
am aware of -
it is a nonsense, and can be justified only in terms of pragmatic
assumptions about
information in the form of paper documents.

We have a very non-orthogonal design where (as someone pointed out) you need
content for some things, you need attributes for others, in some cases you
can use
either, and in some cases neither does the job very well (e.g. storing a
date). I will
resign myself to accepting XML as it is, but to suggest that its
deficiencies are there
because SGML gurus decided ten years ago that they were a good thing is
and not particularly flattering to the SGML gurus, who designed it that way
for a different

In the DTD I've been designing, for what it's worth, I'm currently using
content for nearly
everything, with very little use of attributes. The main reason is for
future extensibility;
elements can always acquire a richer internal structure, while attributes
can't. The
drawbacks (e.g. inability to specify any constraints on values, default
values, etc) don't
actually lose me much, because the constraints available for attributes are
limited anyway.

Mike Kay, ICL
M.H.Kay at eng.icl.co.uk

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