[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Attributes VS Elements

  • From: Newsha Makooi <Newsha@i...>
  • To: 'Sebastien Clement' <sclement@n...>, xml-dev@l...
  • Date: Tue, 05 Sep 2000 15:53:38 -0600

attributes vs elements
Title: RE: Attributes VS Elements

Should you avoid using attributes?

Here are some of the problems using attributes:

-attributes can not contain multiple values (elements can)
-attributes are not easily expandable (for future changes)
-attributes can not describe structures (child elements can)
-attributes are more difficult to manipulate by program code
-attribute values are not easy to test against a DTD
-If you use attributes as containers for data, you end up with documents that are difficult to read and maintain. Try to use elements to describe data. Use attributes only to provide information that is not relevant to the data.

An Exception to the Attribute rule, because rules always have exceptions!
Sometimes you need to assign ID references to elements. These ID references can be used to access XML elements in much the same way as the NAME or ID attributes in HTML. In such cases the ID can be used as an attribute.

You can read more on this @ http://www.w3schools.com/xml/xml_attributes.asp

Hope this helps.
Newsha

-----Original Message-----
From: Sebastien Clement [mailto:sclement@n...]
Sent: Tuesday, September 05, 2000 1:49 PM
To: xml-dev@l...
Subject: Attributes VS Elements


Is there a good resource, or a best practices article, on when to use
elements versus attributes in an XML document?

----------
Sébastien Clément
Web Systems Architect - CBC/Radio-Canada



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.