--- title: position slug: Web/XPath/Functions/position tags: - XSLT - XSLT_Reference translation_of: Web/XPath/Functions/position ---
{{ XsltRef() }}
position 関数は、式評価コンテキストのコンテキスト位置に等しい数値を返します。
{{ 英語版章題("Syntax") }}
position()
{{ 英語版章題("Returns") }}
式評価コンテキストのコンテキスト位置に等しい整数。
{{ 英語版章題("Notes") }}
<xsl:template match="//a[position() = 5]">
<!-- このテンプレートは文書内のあらゆる位置にある
5 番目の a 要素にマッチする -->
</xsl:template>
<xsl:template match="//div[@class='foo']/bar[position() = 1]">
<!-- このテンプレートは class 属性が "foo" に等しい div 要素の子である
1 番目の bar 要素にマッチする -->
</xsl:template>
{{ 英語版章題("Defined") }}
{{ 英語版章題("Gecko support") }}
サポート済み。