我正在使用 xPath 读取 XML 文件,但是当尝试获取某个元素的内容时,它会返回它,包括标签 <> 。
XML 文件的结构如下:
<item>
<attribute01>something</attribute01>
<attribute02>something</attribute02>
<attribute03>something</attribute03>
<attribute04>
<category>Some category name</category>
<category>Some other category name</category>
</attribute04>
</item>
我在 //item 的上下文中工作,然后使用 attribute04//category 来获取类别元素。但是,这就是我要回来的:
xpathparser:04 :
<Category>Bed & Breakfast and Inns</Category>
xpathparser:04 :
<Category>Hotel</Category>
...etc...
它返回包括标签在内的整个元素。有人知道这里出了什么问题吗?
我正在为 Drupal ( https://drupal.org/project/feeds_xpathparser ) 使用 Feeds xPath 解析器模块。
先感谢您。