How to read attribute of a parent node from a child node in XSLT

Just want to know how to read an attribute of a parent node from a child node in XSLT. code:

<A>
  <b attr1="xx">
    <c>
    </c>
  </b>
</A>

XSLT:

<xsl:template match="c">
  <xsl:value-of select="attribute of b node">
</xsl:template>

Solution 1:

You can go "up" a level using "..". So:

<xsl:value-of select="../@attr1"/>