如果元素内的第一个文本,XML 文档内的 HTML 无法正确显示
我正在使用 javascript 提取从 XML 文档返回的数据。此 XML 文件内的元素可能包含 XHTML 标签。当 XHTML 被 CDATA 标记包围时,或者当我手动输入 </> 时,节点值不会显示。当元素内没有 XHTML 格式时,节点值显示正常。
<note title="criteria">
<ul>
<li>If patient has wide complex tachycardia and is pulseless, see VF/Pulseless VT protocol</li>
<li>Stable VT protocol - Asymptomatic or minor symptoms (palpitations, heart racing, etc.)</li>
<li>Unstable VT protocol – <u>HR>150</u> with altered mental status changes, chest pain, hypotension, shock symptoms (cap refill > 2 sec, poor peripheral pulses, cool distal extremities, diaphoresis).</li>
</ul>
</note>
我试图不使用 XSLT,但还有其他方法可以做到这一点吗?
I'm using javascript to pull data returned from an XML document. Inside this XML file are elements that may have XHTML tags inside of them. The nodevalue is not displaying when the XHTML is surrounded by CDATA tags nor when I enter </> manually. When there is no XHTML formatting inside an element, the nodevalue displays fine.
<note title="criteria">
<ul>
<li>If patient has wide complex tachycardia and is pulseless, see VF/Pulseless VT protocol</li>
<li>Stable VT protocol - Asymptomatic or minor symptoms (palpitations, heart racing, etc.)</li>
<li>Unstable VT protocol – <u>HR>150</u> with altered mental status changes, chest pain, hypotension, shock symptoms (cap refill > 2 sec, poor peripheral pulses, cool distal extremities, diaphoresis).</li>
</ul>
</note>
I am trying not to use XSLT but is there any way else to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您查看 嵌入 HTML 标签内部 XML - Dev Shed 并查看 IE XML 数据岛功能NS6+ 浏览器。
I suggest you to see Embedded HTML Tags Inside XML - Dev Shed and also take a look at IE XML Data Island Functionality in NS6+ Browsers.