On Oct 11, 2007, at 5:49 PM, dhess@fishsoftware.com wrote: >> I currently have "xml" as the name of the xml_quote_no_more class, >> so that [xml] and [str] are intended to hint that we are accumulating >> xml or str values. > > The talk of xml has me wondering about a new feature. I would find > useful > a feature of qpy where it would optionally take the result of an [xml] > tagged method/function and run it through an XML parser to check syntax > and maybe even semantics against a specified DTD/schema (XHTML). If > this > were enabled and parsing/validation fails, then an Exception would be > thrown on return from the method/function. Probably Qpy would not want to "grow" into being more domain-specific. It would be interesting though to be able to specialize usage easily, e.g. like you suggest with decorators, but such extensions should be totally separate from core qpy (distinct module). Considerations: Validation against a schema may only be done on a full document? Only well-formedness could be checked on each template? Such checks should be toggle-able, i.e. turned off in deployment. Can that easily be done using decorators? > My motivation for this is that it can be difficult to get an online > validator to validate offline and secure websites. This could also be > useful when using qp to implement REST web services. Ah, but it may be easier in that case to just not use XML... ;-) > I suppose I could implement this with a decorator of my own but it > seems > an interesting feature during development. > > Dave