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: xslt.xpath.Executable -> xslt.xpath.Module

class xslt.Stylesheet

Class methods

classmethod xslt.Stylesheet.compile(type cls, stylesheet, CompileOptions options)

Compiles a new xslt.Stylesheet from the provided xslt.StylesheetProvider and xslt.CompileOptions. This involves loading of the xslt from the xslt.StylesheetProvider, validating and preparing for execution. In case of an xml or a static error, the returned xslt.Stylesheet is None and the xml.ErrorLog contains the error(s).

Returns: (xslt.Styelesheet, xml.ErrorLog).

Attributes

xslt.xpath.Module.location
xslt.xpath.Executable.referenced_modules
xslt.xpath.Module.schema
xslt.xpath.Module.strip_input_type_annotations
xslt.xpath.Module.whitespace_handler

Methods

xslt.Stylesheet.execute(RuntimeOptions options)

Execute the compiled xslt.Stylesheet with the provided xslt.RuntimeOptions. The value of the principal result can be accessed via the xpath.ResultList.main_value property. Note that the actual value in the xpath.Sequence will vary depending on the xpath.DeliveryFormat specified in the xslt.RuntimeOptions. In case of a runtime error the returned xpath.ResultList is None and the xml.ErrorLog contains the error.

Returns: (xslt.ResultList, xml.ErrorLog)

xslt.xpath.Module.load_xml_document(unicode uri, f)

Special methods

__eq__, __ge__, __gt__, __le__, __lt__, __ne__