I think the next phase of the project should be to write an editor widget that does XML syntax highlighting. QT has the QSyntaxHighlighter class which can do this, based on regular expressions matching each of the items that needs to be highlighted. I've spent a good while looking for an existing implementation of regular expressions to match XML elements, attributes etc., and the nearest thing I've found is this. It's enough to get us started, but I think we'll need more.
There's a good example using C++ in the QT examples folder, and the idea looks fairly straightforward, but one problem is going to be the greediness of matching, which may result in matches for opening tags which include all the way to the final closing tag. We should also think about whether we want to check the correctness of e.g. element names; W3C XML Schema Regular Expressions has support for this, and QTSyntaxHighlighter can apparently have its
patternSyntax set to
W3CXmlSchema11, but the effect of this is not really well documented. We'll have to proceed by trial and error.