Newbie Q

James Tauber jtauber at jtauber.com
Tue Aug 25 12:21:08 BST 1998


>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 at jtauber.com      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 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