Kid is a simple, Python-based template language for generating and transforming XML vocabularies. Kid was spawned as a result of a kinky love triangle between XSLT, TAL, and PHP. We believe many of the best features of these languages live on in Kid with much of the limitations and complexity stamped out (well, eventually :).
{'HTML': <kid.serialization.HTMLSerializer object at 0xb7b239cc>,
'HTML-frameset': <kid.serialization.HTMLSerializer object at 0xb7b239ec>,
'HTML-frameset-quirks': <kid.serialization.HTMLSerializer object at 0xb7b23a2c>,
'HTML-quirks': <kid.serialization.HTMLSerializer object at 0xb7b23a0c>,
'HTML-strict': <kid.serialization.HTMLSerializer object at 0xb7b239ac>,
'html': <kid.serialization.HTMLSerializer object at 0xb7b3ac2c>,
'html-frameset': <kid.serialization.HTMLSerializer object at 0xb7b3ac4c>,
'html-frameset-quirks': <kid.serialization.HTMLSerializer object at 0xb7b2398c>,
'html-quirks': <kid.serialization.HTMLSerializer object at 0xb7b3ac8c>,
'html-strict': <kid.serialization.HTMLSerializer object at 0xb7b3ac0c>,
'plain': <kid.serialization.PlainSerializer object at 0xb7b23a4c>,
'wml': <kid.serialization.XMLSerializer object at 0xb7b3ab6c>,
'xhtml': <kid.serialization.XHTMLSerializer object at 0xb7b3abcc>,
'xhtml-frameset': <kid.serialization.XHTMLSerializer object at 0xb7b3abec>,
'xhtml-strict': <kid.serialization.XHTMLSerializer object at 0xb7b3ab8c>,
'xml': <kid.serialization.XMLSerializer object at 0xb7b3aacc>}
{'compact': Format(simple_whitespace=True),
'compact+named': Format(entity_map=True, simple_whitespace=True),
'compact+named+nice': Format(educate=True, entity_map=True, simple_whitespace=True),
'compact+nice': Format(educate=True, simple_whitespace=True),
'default': Format(simple_newlines=True),
'named': Format(entity_map=True, simple_newlines=True),
'newlines': Format(indent='', simple_whitespace=True),
'newlines+named': Format(entity_map=True, indent='', simple_whitespace=True),
'newlines+named+nice': Format(educate=True, indent='', simple_whitespace=True),
'newlines+nice': Format(educate=True, indent='', simple_whitespace=True),
'nice': Format(educate=True, simple_newlines=True),
'nice+named': Format(educate=True, entity_map=True, simple_newlines=True),
'pretty': Format(indent=True, simple_whitespace=True),
'pretty+named': Format(entity_map=True, indent=True, simple_whitespace=True),
'pretty+named+nice': Format(educate=True, entity_map=True, indent=True, simple_whitespace=True),
'pretty+nice': Format(educate=True, indent=True, simple_whitespace=True),
'straight': Format(),
'ugly': Format(simple_newlines=True, stupefy=True),
'wrap': Format(indent='', wrap=True),
'wrap+named': Format(entity_map=True, indent='', wrap=True),
'wrap+named+nice': Format(educate=True, entity_map=True, indent='', wrap=True),
'wrap+nice': Format(educate=True, indent='', wrap=True)}
Convert XML string into an ElementStream.
Enable the kid module loader and import hooks.
This function must be called before importing kid templates if templates are not pre-compiled.
Convert XML document into an Element stream.
Import template by name.
This is identical to calling enable_import followed by an import statement. For example, importing a template named foo using the normal import mechanism looks like this:
import kid kid.enable_import() import foo
This function can be used to achieve the same result as follows:
import kid
foo = kid.import_template('foo')
This is sometimes useful when the name of the template is available only as a string.
Bypass import machinery and load a template module directly.
This can be used as an alternative to accessing templates using the native python import mechanisms.
Get a Template class quickly given a module name, file, or string.
This is a convenience function for getting a template in a variety of ways. One and only one of the arguments name or file must be specified.
Once the template module is obtained, a new instance of the module's Template class is created with the keyword arguments passed to this function.
A class representing an XML element.
This class contains 10 members.
Formatting details for Serializers.
This class contains 31 members.
This class contains 7 members.
Base class for compiled Templates.
All kid template modules expose a class named Template that extends from this class making the methods defined here available on all Template subclasses.
This class should not be instantiated directly.
This class contains 13 members.
This class contains 10 members.
This class contains 16 members.
This class contains 14 members.
The kid module exposes 5 submodules:
See the source for more information.