Welcome Guest!
 editEverything
 Previous Message All Messages Next Message 
RE: XML: is this a good convention?  Tom Ritchford
 May 18, 2001 10:20 PDT 
 The 'Element vs. Attribute' debate has been raging for a while.
I do not think arbitrarily substituting elements and attributes is a good
idea. In fact, I think it is terrible...
see:
http://216.122.205.184/resources/best/bestelematt.htm
and
http://216.122.205.184/resources/best/index.htm

they say:

 The most fundamental difference, which will likely continue to hold
through future iterations of XML development, is that elements can
contain child elements as well as content, while attributes can only
hold content. If it seems at all likely that you'll need to break
down the information stored in a container, make that container an
element.

so:
   attributes MUST be leaves of the DOM tree
   elements can be either leaves or nodes of the DOM tree.


 One way to look at elements and attributes suggests that elements
are the 'real' containers of data, while attributes annotate
elements with additional information describing the content of the
element.

In the case of empty elements, attributes provide additional
information about why the element is present and possibly about what
content it represents.

well. that's clear enough as a rule of thumb.

I'm still unconvinced either way but would tend to use a mixed
style myself (ie, some attributes and some elements) because
it's perhaps clearer and involves less typing,

and I'd use conventions similar to these...


However, it seems strange to have to two ways to do inclusion.

/t


...electronic a cappella madness <http://volectrix.com>.........
...extreme internet radio        <http://extremeNY.com/radio>...
	
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Developers
 Food & Drink
 Health & Fitness
 Internet
 Music
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Software
 Sports
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.