<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="utf-8"/> <xsl:template match="/"> <xsl:text>Patron : NOUN-PROPN-NOUN</xsl:text> <xsl:text>&#xD;&#xA;</xsl:text> <xsl:text>&#xD;&#xA;</xsl:text> <xsl:apply-templates select="//p"/> </xsl:template> <xsl:template match="p"> <xsl:for-each select="item"> <xsl:if test="a[4] = 'NOUN' and following-sibling::item[1]/a[4] = 'PROPN' and following-sibling::item[2]/a[4] = 'NOUN'"> <xsl:value-of select="concat(a[2], ' ',following-sibling::item[1]/a[2], ' ', following-sibling::item[2]/a[2])"/> <xsl:text>&#xD;&#xA;</xsl:text> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>