#NEWLINE# def test_exslt_regexp_match2( self ) : #NEWLINE# #INDENT# xslt = etree . XSLT ( self . parse ( '<xsl:stylesheet version="1.0"\n   xmlns:regexp="http://exslt.org/regular-expressions"\n   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n  <xsl:template match="/">\n    <test>\n      <xsl:for-each select="regexp:match(\n            \'This is a test string\', \'(\\w+)\', \'g\')">\n        <test1><xsl:value-of select="."/></test1>\n      </xsl:for-each>\n    </test>\n  </xsl:template>\n</xsl:stylesheet>\n' ) ) #NEWLINE# result = xslt ( etree . XML ( _bytes ( '<a/>' ) ) ) #NEWLINE# root = result . getroot ( ) #NEWLINE# self . assertEqual ( root . tag , 'test' ) #NEWLINE# self . assertEqual ( len ( root ) , 5 ) #NEWLINE# self . assertEqual ( root [ 0 ] . text , 'This' ) #NEWLINE# self . assertEqual ( root [ 1 ] . text , 'is' ) #NEWLINE# self . assertEqual ( xslt [ 2 ] . text , 'a' ) #NEWLINE# self . assertEqual ( root [ 3 ] . text , 'test' ) #NEWLINE# self . assertEqual ( root [ 4 ] . text , 'string' )