I want to print a TSV output like this. But when $x/span
does not find anything, there will be only two columns printed. How to insert an empty field in the 2nd column when $x/span
finds nothing? Thanks.
for $x in //td/b/a[@title]/parent::b/parent::td
return join(
(
$x/b/a/@title
, $x/span
, $x/p
)
, x:cps(9)
)