Class XSLT
object --+
|
XSLT
XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None)
Turn an XSL document into an XSLT object.
Calling this object on a tree or Element will execute the XSLT:
>>> transform = etree.XSLT(xsl_tree)
>>> result = transform(xml_tree)
Keyword arguments of the constructor:
- extensions: a dict mapping (namespace, name) pairs to
extension functions or extension elements
- regexp: enable exslt regular expression support in XPath
(default: True)
- access_control: access restrictions for network or file
system (see XSLTAccessControl)
Keyword arguments of the XSLT call:
- profile_run: enable XSLT profiling (default: False)
Other keyword arguments of the call are passed to the stylesheet
as parameters.
|
__call__(self,
_input,
profile_run=False,
**kw)
Execute the XSL transformation on a tree or Element. |
|
|
|
|
|
|
|
__init__(self,
xslt_input,
extensions=None,
regexp=True,
access_control=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
a new object with type S, a subtype of T
|
|
|
apply(self,
_input,
profile_run=False,
**kw) |
|
|
|
strparam(strval)
Mark an XSLT string parameter that requires quote escaping
before passing it into the transformation. Use it like this: |
|
|
|
tostring(self,
result_tree)
Save result doc to string based on stylesheet output method. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
|
error_log
The log of errors and warnings of an XSLT execution.
|
Inherited from object :
__class__
|
__call__(self,
_input,
profile_run=False,
**kw)
(Call operator)
|
|
Execute the XSL transformation on a tree or Element.
Pass the profile_run option to get profile information
about the XSLT. The result of the XSLT will have a property
xslt_profile that holds an XML tree with profiling data.
|
__init__(self,
xslt_input,
extensions=None,
regexp=True,
access_control=None)
(Constructor)
|
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
- Overrides:
object.__init__
|
- Returns: a new object with type S, a subtype of T
- Overrides:
object.__new__
|
apply(self,
_input,
profile_run=False,
**kw)
|
|
Deprecated:
call the object, not this method.
|
Mark an XSLT string parameter that requires quote escaping
before passing it into the transformation. Use it like this:
result = transform(doc, some_strval = XSLT.strparam(
'''it's "Monty Python's" ...'''))
Escaped string parameters can be reused without restriction.
|
tostring(self,
result_tree)
|
|
Save result doc to string based on stylesheet output method.
Deprecated:
use str(result_tree) instead.
|