>> I remember that Jim once presented two XML samples and asked which one
>> was more readable.  I preferred many elements over many attributes.  He
>> preferred the opposite.  I thought he was crazy, and as I recall, he
>> thought I was crazy, too. :-)

Elements vs Attributes is an age old debate.  Some points:

- Attributes are not extensible.  When you later realize that your
param="foo" attribute does not provide enough power and you need
<param type="dynamic">$foo</param> you have no choice but to refactor.
This has happened to me countless times...

- XML attributes are not ordered. However, you can prescribe a specific
*element* ordering in an XMLSchema or RelaxNG schema.

- Attributes don't provide the flexibility you need for potentially long
human readable text strings.

- Dozens of child elements pretty print much more nicely than dozens of
attributes.  Pretty printing is *essential* for human readability, IMHO.


Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to