I want to convert
Code:
<postedAt>
<year>2007</year>
<month>12</month>
<day>10</day>
</postedAt>
to
I'm currently using
Code:
<xsl:template match="postedAt">
<xsl:apply-templates select="month" mode="word"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="year"/>
</xsl:template>
<x:date>January</x:date>
<x:date>February</x:date>
<x:date>March</x:date>
<x:date>April</x:date>
<x:date>May</x:date>
<x:date>June</x:date>
<x:date>July</x:date>
<x:date>August</x:date>
<x:date>September</x:date>
<x:date>October</x:date>
<x:date>November</x:date>
<x:date>December</x:date>
<xsl:template match="month" mode="word">
<xsl:value-of select="document('')//x:date[position() = .]" />
</xsl:template>
the last template in that code doesn't appear to be working. What I don't understand is that this works:
Code:
document('')//x:date[position() = 12]
with the 12 instead of .
and yet . contains 12 (I verified this with value-of). I tried using number() but that made no difference.