I have a OOXML (from a Word .docx file) that looks like this:
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>~TABLE_xxx~</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>~TABLE_</w:t>
</w:r>
<w:r w:rsidRPr="00FB4DC5">
<w:t>xxx</w:t>
</w:r>
<w:r>
<w:t>~</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
I want to find all elements where the descendants text contains "~TABLE_xxx~".
I have tried the following:
//w:tr[descendant::text()[contains(., "~TABLE_xxx~")]]
However this only matches the first <w:tr>
of my doc. My guess is that because the second one has text split in different <w:r>
(Word "runs" of text), I don't get a match.
What is the way around that?