@doctest_depends_on(modules=('lxml',))
def apply_xsl(mml, xsl):
 from lxml import etree
 s = etree.XML(get_resource(xsl).read())
 transform = etree.XSLT(s)
 doc = etree.XML(mml)
 result = transform(doc)
 s = str(result)
 return s

@ doctest_depends_on ( modules = ( 'lxml' , ) ) def apply_xsl ( mml , xsl ) : from lxml import etree s = etree . XML ( get_resource ( xsl ) . read ( ) ) transform = etree . XSLT ( s ) doc = etree . XML ( mml ) result = transform ( doc ) s = str ( result ) return s
apply a xsl to a mathml string .