There is a common XML design flaw I see more often than I should. I especially see it in eclipse EXSD designs. I saw it again today, after Mik posted their Discovery Site extension point definition:


<extension
point=“org.eclipse.mylyn.discovery.core.connectorDiscovery”>
<connectorDescriptor
categoryId=“org.eclipse.mylyn.discovery.site.categories.connector
CategoryEclipseOrg”
id=“org.eclipse.mylyn.bugzilla_feature”
license=“EPL”
name=“Mozilla Bugzilla”
provider=“Eclipse Mylyn”
siteUrl=“http://download.eclipse.org/tools/mylyn/update/weekly/e3.4″
…>
<icon
image32=“images/bugzilla32.png”
image64=“images/bugzilla48.png”>
</icon>
<overview
screenshot=“images/bugzilla-screenshot-320×240.png”
summary=“%connectorDescriptor.overview.summary.bugzilla”
url=“http://eclipse.org/mylyn/”>
</overview>
</connectorDescriptor>
</extension>


The problem is defined in chapter 12 of Elliotte Rusty Harold's must read book, "Effective XML". Basically it's the battle over attributes or elements. Elements are extensible, attributes aren't.

The problem in the above markup is the summary attribute in the Overview element. A summary in practice should be a couple of sentences, but what if for some reason somebody needs a couple of paragraphs for the summary? There is no easy way to do this. Sure the content has an externalized string, but this only puts the issue off to a properties file.

This same issue appears through out Eclipse related extension points or where XML is used to describe possibly long descriptions. The XML markup for the Templates files is notoriously bad. Unfortunately nobody is willing to fix it or revisit it.

Please if you are using XML try to use it effectively. A little more thought into how you layout your XML and what you are using it for can go a long way in both maintainability and useability.