apply_templates(self,
context,
node,
output_parent=None,
elements_only=False,
remove_blank_text=False)
|
|
Call this method to retrieve the result of applying templates
to an element.
The return value is a list of elements or text strings that
were generated by the XSLT processor. If you pass
elements_only=True, strings will be discarded from the result
list. The option remove_blank_text=True will only discard
strings that consist entirely of whitespace (e.g. formatting).
These options do not apply to Elements, only to bare string results.
If you pass an Element as output_parent parameter, the result
will instead be appended to the element (including attributes
etc.) and the return value will be None . This is a safe way
to generate content into the output document directly, without
having to take care of special values like text or attributes.
Note that the string discarding options will be ignored in this
case.
|