Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT current() Function

XSLT current() Function


XSLT Function Reference Object Complete XSLT function reference


Definition and Usage

The current() function returns a node-set containing only the current node. Usually, the current node is the same as the context node.

Equal

However, there is a difference. Let's look at the following XPath expression: "catalog/cd". The expression selects the current node's child nodes, and then selects the node's child nodes. This means that at each step of the evaluation, "." has a different meaning.

The following line:

will process all cd elements whose title attribute value equals the value of the ref attribute of the current node.

Unlike this one:

This one processes all cd elements whose title attribute and ref attribute have the same value.


Syntax

node-set current()

Example 1

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Current node:


View the XML file、 View the XSL file、 View the result。


XSLT Function Reference Object Complete XSLT function reference