I'm interested in knowing what are the real difference (benefits and drawbacks) between the two types of python templating engines; XML (like Genshi or Kid) and a custom syntax (like Cheetah or Jinja2).
I'm not looking for which is better, or a recommendation. I understand that no one solution will be perfect, and that the best solution will depend on the problem. I do want to better understand the differences between the two types before I choose one for my problem.
This list may not apply to all templating solutions.
XML Benefits:
- Uses XML, it's mostly familial to developers. There are a few new (ifelse, flow logic) items to learn.
- It works with existing XML toolchains.
- It's more powerful as it is knowledgeable about the data being worked on. (Genshi is context aware)
XML Drawbacks:
- The XML based engines tend to be slower than the custom syntax engines.
- Some will argue that XML is more difficult to learn than custom syntax.
Custom Syntax Benefits:
- It's fast than XML based engines. (see earlier link)
- It's a simple powerful syntax that should be easier to learn.
Custom Syntax Drawbacks:
- It's another syntax to learn.
- It might not work smoothly with existing XML toolchains.