I’ve this table with source code HERE:

I want to get all rows, wich I can do using:

The expected final output using string-join($doc//*[@id='salaries']/tbody/tr/normalize-space(.), '
') is:
1985-86 Los Angeles Lakers NBA $2,030,000
1987-88 Los Angeles Lakers NBA $2,000,000
1988-89 Los Angeles Lakers NBA $3,000,000
My question is, how to remove the third column (named NBA in this example) from the final output to get this:
1985-86 Los Angeles Lakers $2,030,000
1987-88 Los Angeles Lakers $2,000,000
1988-89 Los Angeles Lakers $3,000,000
ps: I’m not sure that column is always in that place, but the anchor contains ‘league’ in it a[contains(@href, 'league')]
This XPath 2.0 expression:
when evaluated on the provided XML document:
produces the wanted, correct result:
If the position of the column to be excluded isn’t guaranteed to be fixed, use: