Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Returns a node set that has the current node as its only member.

Syntax

		
node-set current()

Parameters

None.

Return Value

Returns a node set that has the current node as its only member.

Remarks

The function returns a node set that has the current node as its only member. For an outermost expression, an expression not occurring within another expression, the current node is always the same as the context node; thus

Copy Code
<xsl:value-of select="current()"/>

is the same as the following code.

Copy Code
<xsl:value-of select="."/>

However, within square brackets, the current node is usually different from the context node, as shown in the following example.

Copy Code
<xsl:apply-templates
select="//glossary/item[@name=current()/@ref]"/>

processes all <item> elements that have a <glossary> parent element and a nameattribute with value equal to the value of the current node's refattribute. This is different from

Copy Code
<xsl:apply-templates select="//glossary/item[@name=./@ref]"/>

which means the same as the following code.

Copy Code
<xsl:apply-templates select="//glossary/item[@name=@ref]"/>

This code would process all <item> elements that have a <glossary> parent element and that have a nameattribute and a refattribute with the same value.

See Also

Reference

XSLT Functions