Consider simple XML document:
Item 1 Item 2 2条回答 忘掉有多难 (楼主) 2020-12-06 11:52 If you're using XPath 2.0 you can just use /html/body/table/tr/td/normalize-space(.). If you're stuck with XPath 1.0, I don't believe this is possible. You'll just have to loop over the resulting strings and normalize them. 0 讨论(0) 查看其它2个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
If you're using XPath 2.0 you can just use /html/body/table/tr/td/normalize-space(.).
/html/body/table/tr/td/normalize-space(.)
If you're stuck with XPath 1.0, I don't believe this is possible. You'll just have to loop over the resulting strings and normalize them.