next
prev
first
position()
and
last()
Returns the position of an item in a sequence
Syntax:
item/position()
Example:
//role/position()
returns the number of each role in the list of roles
Task: find the stage direction in the last line Hamlet speaks
Note: the
last()
function returns the sequence number of the last node in the set
A first dozen XPath functions, slide 8 of 9
© 2011 David J. Birnbaum and Brown WWP This TEI-encoded XML file is available under the terms of the Creative Commons Attribution-ShareAlike 3.0 (Unported) license.