#NEWLINE# def test_xslt_copy( self ) : #NEWLINE# #INDENT# tree = self . parse ( '<a><b>B</b><c>C</c></a>' ) #NEWLINE# style = self . parse ( '<xsl:stylesheet version="1.0"\n    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n  <xsl:template match="*" />\n  <xsl:template match="/">\n    <foo><xsl:value-of select="/a/b/text()" /></foo>\n  </xsl:template>\n</xsl:stylesheet>' ) #NEWLINE# transform = etree . XSLT ( style ) #NEWLINE# res = transform ( tree ) #NEWLINE# self . assertEqual ( '<?xml version="1.0"?>\n<foo>B</foo>\n' , str ( res ) ) #NEWLINE# transform_copy = copy . deepcopy ( tree ) #NEWLINE# res = transform_copy ( tree ) #NEWLINE# self . assertEqual ( '<?xml version="1.0"?>\n<foo>B</foo>\n' , str ( res ) ) #NEWLINE# transform = etree . XSLT ( style ) #NEWLINE# res = transform ( tree ) #NEWLINE# self . assertEqual ( '<?xml version="1.0"?>\n<foo>B</foo>\n' , str ( res ) )