It would be great to support XHTML not only as "leaf" content, in WText, but also as an intermediate container in which you may again instantiate other widgets. This would be especially useful for using XHTML for (top-level) layout purposes.
WTemplate takes a
WString containing a template (which can thus be easily pushed out to an XML resource file). The template is plain XHTML, with support for a special (non-XHTML) tag:
<widget wid="myButton" class="btn" ... />
wt:widget should that be easy to make XML parsers accept).
WTemplate should define two member methods:
virtual WWidget *createWidget(const std::string &wid): looks up the widget to substitute each widget tag found in the template. The default implementation will consult a
map<std::string, WWidget *>of widgets. Attributes defined for the widget are set to the
setWidget(const std::string& wid, WWidget *widget): adds a widget to the map.