0

我有以下 html 片段

       <span class='ocr_line' id='line_11' title="bbox 0 482 377 539">
<span class='ocrx_word' id='word_34' title="bbox 0 484 51 539"><em>WORD1</em></span> 
<span class='ocrx_word' id='word_35' title="bbox 56 482 119 528">WORD2</span> 
<span class='ocrx_word' id='word_35' title="bbox 56 482 119 528"><em></em></span> 
<span class='ocrx_word' id='word_36' title="bbox 137 483 171 528"><strong><em>WORD3</em></strong></span> 
<span class='ocrx_word' id='word_37' title="bbox 176 482 244 528"><h1>WORD4</h1></span> 
</span> 

我希望 xpath 查询字符串能够提取 bbox 字符串和单词 1-4 的节点内容。我遇到了麻烦,因为单词嵌套在<em>s 和<strong>s 中,也可能是空的!谢谢。

4

1 回答 1

0

这也许://@title | //text()

于 2013-03-27T19:00:39.070 回答