1

例如,我有一个在 xml 中嵌入了 html 标签的输入文件

 <Root>
   <Section1>
   <p>some text</p>
   <br>
   <table>
       <th></th>
       <tr>
       <td></td> 
       </tr>    
   </table>
   </Section1>
  <Section2>
  <ol>
      <li>1</li>
      <li>2</li>
      <li>3</li>
  </ol>
  </Section2>
</Root>

有没有办法解析嵌入在 R 中的 xml 文档中的 html?

4

1 回答 1

3

如果它是 XHTML,那么它应该是 XML,所以你使用标准的 XML 解析器。你可以在其他地方找到很多关于这些的信息。

请注意,您的<Section1>标签未正确关闭。如果这是您粘贴的文件,则说明它有问题。

于 2013-01-11T08:54:27.247 回答