Nokogiri xpath () or operator?

Is there a way that I can accomplish the following using Nokogiri xpath() ?

 doc.xpath("//pod[@id=or('anid','anotherid')]") 
+6
source share
3 answers

Try doc.xpath("//pod[@id='anid' or @id='anotherid']")

+9
source

Try this XPath:

 doc.xpath("//pod[@id='anid' or @id='anotherid']") 
+3
source

It also helped me:

 sect_pr.xpath("//pod[@id='anid']", "//pod[@id='anotherid']") 

It returns a NodeSet

I got code like this:

 sect_pr.xpath('//w:headerReference or //w:footerReference') 

And it returns true insted NodeSet

0
source

Source: https://habr.com/ru/post/903799/


All Articles