Print

XML Schema for Swixml
xsd Writing a Swixml declaration file is not that hard, if you know your javax.swing components. However, getting a little support from your XML-Editor or IDE certainly doesn't hurt.
Getting IntelliSense help sometimes doesn't require much more than pointing your editor to a DTD or XML Schema to pop-up element and attribute names as needed; or simply adding an xsi:schemaLocation attribute to the root element might do the trick.
Anyway, I've generated the XML-Schema for all built-in Swixml elements and attributes and made it available here: http://www.swixml.org/2007/swixml.xsd
It is complete, concerning elements and their attributes, and while the schema already has more than 2700 lines (which tells a story about the complexity of Swing), it does not include containment-rules, e.g. that you shouldn't add a button into a label, nor does it validate the attribute values other than booleans.

Here is how you would associate the XML Schema to an Swixml XML descriptor:



After that's done, some tool may make writing the descriptors somewhat easier. Oxygen XML Editor for instance has code competitions for elements and attributes:
IntelliSense in OxygenXML


IntelliSense in OxygenXML

With IntelliJ-IDEA on the other hand, even after registering the URI in System/Settings/Resources, I could only get completion for elements but not for the attributes to work:

IntelliSense in OxygenXML

Give it a try and let me know what you think and how we should improve the xsd. Again, the schema can be downloaded here: http://www.swixml.org/2007/swixml.xsd
The XML-Schema for Swixml is obviously generated using Java Reflection and the code will be made available in the upcoming Swixml 1.6. The cool thing about this is that you can generate your own XSD after you have registered all your own and 3rd party components. That way your Schema will allow you to use IntelliSense on your own elements just like it works on the built-in ones.