Changes between Version 21 and Version 22 of GenshiFaq
- Timestamp:
- Sep 11, 2006, 6:49:15 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiFaq
v21 v22 49 49 50 50 Beyond the XML-based template engine, Genshi provides: 51 * a [ GenshiStreamunified stream-based processing model] for markup, where52 * streams can come from XML or HTML text, or be [ GenshiBuildergenerated programmatically] using a very simple syntax.53 * [ GenshiPathXPath] can be used to query any stream, not just in templates.51 * a [wiki:Documentation/streams.html unified stream-based processing model] for markup, where 52 * streams can come from XML or HTML text, or be [wiki:Documentation/builder.html generated programmatically] using a very simple syntax. 53 * [wiki:Documentation/xpath.html XPath] can be used to query any stream, not just in templates. 54 54 * Different serialization methods (XML, HTML, and plain text) for streams. 55 55 * An HTML “sanitizing” filter to strip potentially dangerous elements or attributes from user-submitted HTML markup. … … 60 60 We think that includes are both simpler and more natural for templating. 61 61 62 Template inheritance is a concept that fits well with template languages where a master template provide “slots” that are “filled” by the inheriting templates. However, Genshi has no such feature, and instead uses the more powerful and flexible concept of [wiki: GenshiTemplates#py:matchmatch templates].62 Template inheritance is a concept that fits well with template languages where a master template provide “slots” that are “filled” by the inheriting templates. However, Genshi has no such feature, and instead uses the more powerful and flexible concept of [wiki:Documentation/xml-templates.html match templates]. 63 63 64 64 Furthermore, [http://www.w3.org/TR/xinclude/ XInclude] is a [http://www.w3.org/ W3C] standard, which means that it is more likely to be supported in authoring tools than some esoteric custom notation for including external resources. … … 67 67 68 68 [[Image(http://static.edgewall.org/gfx/opensource-75x65.png, width=75, height=65, align=right)]] 69 69 70 === What license governs the use of Genshi? === 70 71 … … 98 99 * The `Markup` class in the [ApiDocs/GenshiCore genshi.core] module can be used to flag strings that should not be escaped. Strings wrapped in a `Markup` instance get copied to the output unchanged. 99 100 * The `XML` and `HTML` functions in the [ApiDocs/GenshiInput genshi.input] module parse XML and HTML strings, respectively, and produce a [GenshiStream markup stream]. Note that this option can be rather expensive, as the text needs to be parsed just to be serialized again. Also, this method fails on bad markup that cannot be parsed by either [http://docs.python.org/lib/module-HTMLParser.html HTMLParser] or [http://docs.python.org/lib/module-xml.parsers.expat.html Expat]. 100 * If you are generating the snippets in question yourself, you may want to use the [ApiDocs/GenshiBuilder genshi.builder] to [ GenshiBuildergenerate markup streams programmatically]. Just as the results of the `XML` and `HTML` functions discussed above, the stream produced using `genshi.builder` will not be escaped in the template output.101 * If you are generating the snippets in question yourself, you may want to use the [ApiDocs/GenshiBuilder genshi.builder] to [wiki:Documentation/builder.html generate markup streams programmatically]. Just as the results of the `XML` and `HTML` functions discussed above, the stream produced using `genshi.builder` will not be escaped in the template output. 101 102 102 103 ---- 103 See also: GenshiGuide, GenshiRecipes104 See also: [wiki:Documentation], GenshiRecipes