Professional XML Databases from Kevin Williams & C
I am reading Prof. XML Databases from Kevin Williams and co.
They suggested the reader to use Attributes instead of elemets.
My question is:
Is Attributes is really better than Elements?
for example if I would like to give a discount for people who buy my product, lets say 1 cost 50 Dollar, and if you buy 2 o 12 cost only 48.25 dollar and so on.
So my Elements look like this:
<product>
<price>50.00
<discounts>
<discount from=" 2" to="12">48.25</discount>
<discount from="13" to="24">46.55</discount>
<discount from="25" to="99">45.00</discount>
</discounts>
</price>
</product>
and my Attributes look like this below (and bit confusing)
<product price="50.00"
disc-02-12="48.25"
disc-13-24="46.55"
disc-25-99="45.00"
</product>
So dear Mr.Williams and CO, or any other people....could you please help me? what's decision for this? I think sometimes Attributes are nice but sometimes it will confuse you too.
|