[Zope3-dev] Re: Deploying WSGI Apps with Zope 3.2+

cstrong at arielpartners.com cstrong at arielpartners.com
Mon Jan 30 16:44:28 EST 2006


>> 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.

hth,

--Craeg


More information about the Zope3-dev mailing list