xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Wygand <...@wygand.com>
Subject Re: Attribute and Element
Date Thu, 18 May 2000 22:07:04 GMT
This is a cause of much debate and consternation for me. What I've
generally decided is that the relationship come down to IS A and HAS A.
If the thing in question is an integral part of the object represented
by the parent, then make it an attribute. However, if it's another
seperate 'object' and the parent known owns it, then I make it a child

This is all still highly subjective, but I always try to think how I'd
model this in an RDBMS and then use a similar scheme.

An example is...

  <Headers From="rob@wygand.com" 
           Subjec"Hello, there foo"/>
  <Body content_type="text/plain" content_encoding="7bit">
     Test message!
  <Attachment content_type="image/gif" name="myhouse.jpg"
[... etc ...]

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?

View raw message