def _transform_lxml(xml, xslt_path, params=None):
    """
    Transform ``xslt`` using any of the 2 supported xslt engines:

    - `lxml <http://codespeak.net/lxml/>`_
    - `libxml <http://xmlsoft.org/python.html>`_

    :param xml: The xml to be transformed.
    :param xslt: The xslt to be used when transforming the ``xml``.
    :param params: A dictionary containing xslt parameters. Use :func:`~easymode.xslt.prepare_string_param`\
        on strings you want to pass in.
    """
    # assuming params where created with prepare_string_param,
    # they are encoded as unicode, which lxml does not like
    
    xml_doc = etree.fromstring(xml)
    xslt_doc = etree.parse(xslt_path)
    xslt_proc = etree.XSLT(xslt_doc)

    if params:
        for (key, value) in params.iteritems():
            params[key] = value.decode('utf-8')
        result = xslt_proc(xml_doc, **params)
    else:
        result = xslt_proc(xml_doc)
    
    return unicode(result)
def _transform_lxml ( xml , xslt_path , params = None ) : xml_doc = etree . fromstring ( xml ) xslt_doc = etree . parse ( xslt_path ) xslt_proc = etree . XSLT ( xslt_doc ) if params : for ( key , value ) in params . iteritems ( ) : params [ key ] = value . decode ( 'utf-8' ) result = xslt_proc ( xml_doc , ** params ) else : result = xslt_proc ( xml_doc ) return unicode ( result )
Transform ``xslt`` using any of the 2 supported xslt engines:

    - `lxml <http://codespeak.net/lxml/>`_
    - `libxml <http://xmlsoft.org/python.html>`_

    :param xml: The xml to be transformed.
    :param xslt: The xslt to be used when transforming the ``xml``.
    :param params: A dictionary containing xslt parameters. Use :func:`~easymode.xslt.prepare_string_param`\
        on strings you want to pass in.