En la muestra xml anterior, me gustaría seleccionar todos los libros que pertenecen a la clase foo y no en la barra de clases mediante el uso de xpath.¿Cómo puedo seleccionar un elemento con múltiples clases con Xpath?
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book class="foo">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book class="foo bar">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book class="foo bar">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
Buena pregunta, 1. Vea mi respuesta para dos soluciones XPath 2.0 diferentes, de las cuales la primera podría ser la más eficiente de todas, especialmente con un motor XPath 2.0 que no optimiza. –