I really appreciate all the replies!! Since Friday, I've been analyzing each one of them in order to better understand our options here. Also, I've been checking this site
http://www.dpawson.co.uk and getting some ideas!
Sam, this may sound stupid, but could you please tell me why in my for-each loop the first test is testing the whole array, and what changes I have to do in order to start evaluating the first position instead of the entire array??
I tried another test, just to better understand how for-each works:
<xsl:variable name="teste" select="tokenize('tchau ola tchau', '\s')"/>
<xsl:for-each select="$teste">
<xsl:choose>
<xsl:when test="$teste = 'ola'">
<xsl:text>Achei ola!</xsl:text>
</xsl:when>
<xsl:when test="$teste = 'tchau'">
<xsl:text>Achei tchau!</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Nao nada!</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
I thought the output would be something like:
Achei tchau!
Achei ola!
Achei tchau!
However, I get:
Achei ola!
Achei ola!
Achei ola!
Btw, you were correct with the $test variable; when I posted the first message, I forgot changing '$teste' to '$msg'. Sorry!