Feb 25, 2008

current()

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,


is the same as

However, within square brackets, the current node is usually different from the context node. For example,


processes all elements that have a parent element and a name attribute with value equal to the value of the current node's ref attribute. This is different from


which means the same as
            
and so would process all elements that have a parent element and that have a name attribute and a ref attribute with the same value.