XPath with multiple conditions
Try://category[@name='Sport' and ./author/text()='James Small']
Use:
/category[@name='Sport' and author/text()[1]='James Small']
or use:
/category[@name='Sport' and author[starts-with(.,'James Small')]]
It is a good rule to try to avoid using the //
pseudo-operator whenever possible, because its evaluation can typically be very slow.
Also:
./somename
is equivalent to:
somename
so it is recommended to use the latter.