I get the error "Nokogiri::XML::XPath::SyntaxError: ERROR: Undefined namespace prefix" when I do this:
doc.search('//text()[not(ancestor::w:delText]')
Based on this answer: How do I use xpath on nodes with a prefix but without a namespace?
*[name()="w:delText"]
can sort of solve the problem. But how do I do something similar like this to avoid the namespace error:
doc.search('//text()[not(ancestor::*[name()="w:delText"]')