I want to select the previous node only if it is a text node (and contains only whitespace). I have an XPath like so:
path/preceding-sibling::node()[normalize-space()='']. This works great but matches both text and element nodes (if the nodes contain only whitespace). Using
path/preceding-sibling::text()[normalize-space()=''] will select the first preceding node that is a text node which is definitely not what I want if there are any elements in between.
How can I combine the two tests?