Off topic (Re: Embedding Content as Element Content or As An Attribute Value)

Rick Jelliffe ricko at allette.com.au
Sat Jan 10 11:19:24 GMT 1998


 
> From: Michael Kay <M.H.Kay at eng.icl.co.uk>

> 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 modelling 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.

An efficient language will provide not only a modeling syntax but also contractions.
For example, most character sets have precomposed characters (i.e. the base
character with its accent) for the most common accented characters of the locale,
as well as or rather than factoring all the accents our into separate non-spacing
character codes. Attributes in the main represent such a contraction mechanism. 

The designer of a document type may also decide to use elements for the most 
interesting structure (as far as that designer is concerned) and use attributes 
for other decorations.

Attributes can have guaranteed unique names as their values (IDs), which is not
available for elements.

None of these three things (contraction, decoration, uniqueness) have much if
anything to do with the metaphysics of the thing modeled or the nature of paper
publications. I doubt any of these things will actually perplex good philosophers
or language designers. 

> 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. 

This is a good reason. But not everyone has your documents or needs or
bent of mind. Let 1000 flowers blossom. The only time I investigated
DTDs which did not use any attributes, it turned out to be because the
processing software of the company involved did not support them easily:
it was a (slack) pragmatic reason.

> 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 very limited anyway.

SGML was revised last year to allow explicit arbitrary typing of attributes.
I hope XML will get this too sometime.


Rick Jelliffe


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