xslt.Stylesheet
¶
The xslt.Stylesheet
class represents a valid, compiled xslt stylesheet.
It can be instantiated with the xslt.Stylesheet.compile()
classmethod.
The same xslt.Stylesheet
can be used for multiple executions with different xslt.RuntimeOptions
.
There is also a utility function xslt.compile()
that can be used to create an xslt.Stylesheet
.
Base class: xquery.xpath.Executable
-> xquery.xpath.Module
- class xslt.Stylesheet¶
Class methods¶
- classmethod xslt.Stylesheet.compile(type cls, stylesheet, CompileOptions options)¶
Compiles a new
xslt.Stylesheet
from the providedxslt.StylesheetProvider
andxslt.CompileOptions
. This involves loading of the xslt from thexslt.StylesheetProvider
, validating and preparing for execution. In case of an xml or a static error, the returnedxslt.Stylesheet
is None and thexml.ErrorLog
contains the error(s).Returns: (xslt.Styelesheet,
xml.ErrorLog
).
Attributes¶
- xquery.xpath.Module.location
- xquery.xpath.Executable.referenced_modules
- xquery.xpath.Module.schema
- xquery.xpath.Module.strip_input_type_annotations
- xquery.xpath.Module.whitespace_handler
Methods¶
- xslt.Stylesheet.execute(RuntimeOptions options)¶
Execute the compiled
xslt.Stylesheet
with the providedxslt.RuntimeOptions
. The value of the principal result can be accessed via thexpath.ResultList.main_value
property. Note that the actual value in thexpath.Sequence
will vary depending on the xpath.DeliveryFormat specified in thexslt.RuntimeOptions
. In case of a runtime error the returnedxpath.ResultList
is None and thexml.ErrorLog
contains the error.Returns: (xslt.ResultList,
xml.ErrorLog
)
- xquery.xpath.Module.load_xml_document(unicode uri, f)
Special methods¶
__eq__, __ge__, __gt__, __le__, __lt__, __ne__