CDATA 中标签的 Xpath [英] Xpath to the tag inside CDATA

查看:22
本文介绍了CDATA 中标签的 Xpath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到 CDATA 中标签的 xpath.在 xml 片段下方.

I want to find the xpath to a tag which is inside a CDATA. Below the xml fragment.

<books>
 <book>
  <title></title>
  <content><![CDATA[<p>Hi hello Hw r u?</p><p>We are fine</p><p>Hi babeeee!!!!</p>]]>    </content>
 </book>
</books>

我想获取中第一个

标签内的数据.任何人都可以给它正确的xpath吗?

I want to get the data which is inside the first <p> tag inside <content>. Can anybody please give the correct xpath to it?

推荐答案

CDATA 包含任意字符数据.与 PCDATA(parsed 字符数据的首字母缩写词)相反,它没有被解析,所以它里面没有元素"的 xpath.

CDATA contains arbitrary character data. In contradiction to PCDATA (acronym of parsed character data) it is not parsed, so there is no xpath to "elements" inside of it.

这篇关于CDATA 中标签的 Xpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆