I have a string that is 141 characters in length. Using the following code I have an if statement to return a message if the string is greater or less than 140.
if
An XPath solution is to use:
string-length((//div[@class='contest'])[$k])
where $k should be substituted by a number.
This evaluates to the string length of the $k-th (in document order) div in the XML document that has a class attribute with value 'contest'.
div
class