XPath Confusion

I have a macro that is pulling in nodes that have been selected from a tree picker into a type of news feed for the page that it is placed on. I am trying to add the value of the parent of the "NewsArticle", which would be the "NewsCategory" and output the value of the category to the individual items in the "NewsFeed".

Here is the xslt, but I am not getting any output from the value-of select statement.

<xsl:variable name="categoryName">
	<xsl:call-template name="node-name">        
	<xsl:with-param name="node" select="$currentPage/ancestor-or-self::NewsHome//NewsArticle[@id=current()/@id]/ancestor::NewsCategory" />
         </xsl:call-template></xsl:variable><xsl:value-of select="$categoryName" />
<xsl:template name="node-name">
  <xsl:param name="node" />  
  <xsl:if test="string($node) != ''">
    <xsl:choose>
      <xsl:when test="$node/pageTitle != ''">
        <xsl:value-of select="$node/pageTitle"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$node/@nodeName"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>

This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/64906-xpath-confusion