Is there a way I can accomplish the following using Nokogiri's xpath()
?
doc.xpath("//pod[@id=or('anid','anotherid')]")
Is there a way I can accomplish the following using Nokogiri's xpath()
?
doc.xpath("//pod[@id=or('anid','anotherid')]")
Try doc.xpath("//pod[@id='anid' or @id='anotherid']")
or
works as an operand (like something or something
), not as a function (like or(something, something)
). –
Helbonna Try this XPath:
doc.xpath("//pod[@id='anid' or @id='anotherid']")
This also worked for me:
sect_pr.xpath("//pod[@id='anid']", "//pod[@id='anotherid']")
It returns NodeSet
I got code like this:
sect_pr.xpath('//w:headerReference or //w:footerReference')
And it return true
insted NodeSet
© 2022 - 2024 — McMap. All rights reserved.