As part of Canard, there is need for a very simple XML editor while the rich-text capabilities are finalised. So for the upcoming release, rather than work with a complex GUI, I’ve taken the easy option and will just allow the user to edit the very cut back rich text XML itself.

The complication with this is that a survey designer could write some invalid XML, which would be inserted into the rest of the document and break the entire file. The solution is to provide as-you-type validation of the XML to check that is valid. Fortunately, this is not as difficult as might be imagined, thanks to how easy to put together PyQt and Python are in general

Below is a screen shot of this little editor in action, with a very short code snippet that demonstrates how to do as-you-type XML validation inside of a PyQt application.

Simple PyQT XML Editor in action

Simple PyQT XML Editor in action

[

</span>](https://gist.github.com/6402059)