Changes between Version 5 and Version 6 of GenshiFaq
- Timestamp:
- Jul 7, 2006, 6:33:32 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiFaq
v5 v6 22 22 == Why XML-based? == 23 23 24 Most template engines for web applications are character-stream based: they know nothing about the format of the text that is being generated. They simply substitute variable expressions, and provide some kind of directives looping, conditionals, etc. Thus they can be used to generate any kind of textual output, be it HTML, plain text emails, program code, or really anything else.24 Most template engines for web applications are character-stream based: they know nothing about the format of the text that is being generated. They simply substitute variable expressions, and provide some kind of directives for looping, conditionals, etc. Thus they can be used to generate any kind of textual output, be it HTML, plain text emails, program code, or really anything else. 25 25 26 26 However, 99% of the templates used by web applications generate some kind of XML/HTML-based markup. So we believe that web applications can benefit from a template engine that “knows what it's doing” when it comes to markup. You don't need to worry about generating output that is not well-formed, nor do you need to worry about accidentially not escaping some data, thereby greatly reducing the risk for introducing [http://de.wikipedia.org/wiki/Cross_Site_Scripting XSS] attack vectors. Furthermore, your templates look a lot more like the targetted output format: an HTML template looks like HTML, a template for an RSS feed looks like RSS. Directives in text-based template languages often result in rather messy templates, or produce excessive amounts of unnecessary white space.