xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clark C. Evans" <...@clarkevans.com>
Subject Re: Attribute and Element
Date Thu, 18 May 2000 22:45:14 GMT
On Thu, 18 May 2000, Cheun N Chong wrote:
> 	The confusion I am having now is, should I put the Price (or
> ValidBefore) as an attribute of the Ticket or put it as an element under
> the Ticket. What is the difference, and what is the benefits?

I forgot two other points. If you make it an attribute; then
you have both elements and attributes in your document.  If you 
stick with just elements, you avoid one form of syntax.  IMHO,
when explaining the data to a manager, it's alot easier to avoid
the whole element/attribute question by leaving the attributes
out to begin with.  ;)

In general, for B2B markup... attributes aren't really 
needed.  However, they *are* very valueable if you have
mixed content; like HTML.  Think "adverb".

  <body> this is mixed <font color="red">content </font></body>
Arguably (and long arguments indeed), color is on a 
different 'plane' than font thus it requires a different
syntax so that it's value, "red" is not considered part
of the body's content.   This is easily made concrete by
looking at the XSLT string-value operator;  which 
is loosely defined for an element as the concatination 
of all text children.  Thus, the string-value of the <body> 
above does not contain "red", but it does contain "content".

Once again, for B2B stuff... I don't think this makes
a ton of difference; but the differences (and resulting
confusion?) are strong enough to make me steer clear
of attributes when I can do so.



View raw message