XmlResourceBundle added to Messages

I have added a XmlResourceBundle to cintoo Messages.

<properties>
<property key="mykey">myvalue</property>
</properties>

The greatest benefits with XML are that you can easier use encodings in XML files than in the default Java properties bundles. And you can use XML-based tools for bundle creation and management. The bundle also shows the direction Messages is going. Easy adobtable to your project requirements.
The XmlResourceBundle is easy to extend. As an example for another Xml properties
format I chose one from Cocoon.

The format is different from the default properties xml format in Messages, so some adaptions are needed.

<categories>
<message key="mykey">myvalue</message>
</categories>

Messages xml uses Apache Jakarta Digester. We have to tell Digester how to map the xl tags to the properties class.

public class CocoonXmlResourceBundle extends XmlResourceBundle {
public CocoonXmlResourceBundle(String baseName, Locale locale) {
super(baseName, locale);
}

protected Digester configure(Digester digester) {
digester.addObjectCreate("catalogue/message", Property.class);
digester.addSetNext("catalogue/message", "addProperty", "cintoo.messages.bundle.xml.Property");
digester.addBeanPropertySetter("catalogue/message", "value");
digester.addSetProperties("catalogue/message", "key", "key");
return digester;
}
}

That's it. And it's as easy to adapt XmlResourceBundle to other formats.