You have to think about containers and descriptors.
If the item is a container => element
If the item is a description => attribute.
I like the bottle example :
You have 3 things that describe the bottle :
- what is in it,
- the color of the glass
- the transparancy degree.
Thinking of the container & descriptors it give you this schema :
<bottle color="green" transparancy="80%">
so in your example, color must be an attribute.
From: Santosh Kumar [mailto:[log in to unmask]]
Sent: Thursday, September 14, 2000 12:31 PM
To: [log in to unmask]
Subject: Attributes Vs Elements
When should one decide to use attributes instead of elements
containing the data. I mean to say..How do i decide which one to use and
Not every case is as simple as above.& what is the trade off?
= Santosh Kumar C =
= Senior Systems Engineer =
= Wipro Technologies =
= 1-8-448, Laxmi Building, S.P. Road, =
= Begumpet, Secunderabad - 500 003 =
= A.P, India. =
= Phone@: 91407896008 Ext 4511 =
= Fax @: 91407896123 =
= eMail@: [log in to unmask] =
= url @: http://www.wipro.com =
= The World's First SEI CMM Level 5 Software Services Company =