I don’t see why you can’t use this:
//table[@id='foo']/tr|//table[@id='foo']/tbody/tr
If you want one expression without node set union:
//tr[(.|parent::tbody)[1]/parent::table[@id='foo']]
I don’t see why you can’t use this:
//table[@id='foo']/tr|//table[@id='foo']/tbody/tr
If you want one expression without node set union:
//tr[(.|parent::tbody)[1]/parent::table[@id='foo']]