Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 05:51 PM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old May 6th, 2005, 06:02 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

This is an ancient debate, and anything worth saying on the topic can be found at

http://xml.coverpages.org/elementsAndAttrs.html



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying Databases & Foreign Keys donevco Access 5 February 20th, 2007 08:31 AM
Professional ASP.NET 2.0 Databases bonekrusher BOOK: Beginning ASP.NET 2.0 and Databases 2 January 3rd, 2007 10:37 AM
Professional VB6 & XML mauro XML 3 May 4th, 2005 07:33 PM
Professional XML Databases - Where's the code? MizTaken All Other Wrox Books 2 March 18th, 2005 02:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.