#NEWLINE# def test_multiple_elementrees( 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="a"><A><xsl:apply-templates/></A></xsl:template>\n  <xsl:template match="b"><B><xsl:apply-templates/></B></xsl:template>\n  <xsl:template match="c"><C><xsl:apply-templates/></C></xsl:template>\n</xsl:stylesheet>' ) #NEWLINE# self . assertEqual ( self . _rootstring ( tree ) , _bytes ( '<a><b>B</b><c>C</c></a>' ) ) #NEWLINE# result = tree . xslt ( style ) #NEWLINE# self . assertEqual ( self . _rootstring ( tree ) , _bytes ( '<a><b>B</b><c>C</c></a>' ) ) #NEWLINE# self . assertEqual ( self . _rootstring ( result ) , _bytes ( '<A><B>B</B><C>C</C></A>' ) ) #NEWLINE# b_tree = etree . ElementTree ( tree . getroot ( ) [ 0 ] ) #NEWLINE# self . assertEqual ( self . _rootstring ( b_tree ) , _bytes ( '<b>B</b>' ) ) #NEWLINE# result = b_tree . xslt ( style ) #NEWLINE# self . assertEqual ( self . _rootstring ( tree ) , _bytes ( '<a><b>B</b><c>C</c></a>' ) ) #NEWLINE# self . assertEqual ( self . _rootstring ( result ) , _bytes ( '<B>B</B>' ) ) #NEWLINE# c_tree = etree . ElementTree ( tree . getroot ( ) [ 1 ] ) #NEWLINE# self . assertEqual ( self . _rootstring ( c_tree ) , _bytes ( '<c>C</c>' ) ) #NEWLINE# result = c_tree . xslt ( style ) #NEWLINE# self . assertEqual ( self . _rootstring ( tree ) , _bytes ( '<a><b>B</b><c>C</c></a>' ) ) #NEWLINE# self . assertEqual ( self . _rootstring ( result ) , _bytes ( '<C>C</C>' ) )