【发布时间】:2013-04-18 15:14:55
【问题描述】:
CDATA 中要解析为 Html 的数据。
<?xml version="1.0" encoding="utf-8" ?>
<test>
<test1>
<![CDATA[ <B> Test Data1 </B> ]]>
</test1>
<test2>
<![CDATA[ <B> Test Data2 </B> ]]>
</test2>
<test3>
<![CDATA[ <B> Test Data3 </B> ]]>
</test3>
</test>
从上面的输入 xml 我需要将输出解析为 html。
但我得到的输出为
<B>Test Data1</B>
<B>Test Data2</B>
<B>Test Data3</B>
但实际输出我需要将文本加粗。
**Test Data1
Test Data2
Test Data3**
输入来自外部系统。我们无法更改 CDATA 中的文本
【问题讨论】:
-
您的 XSLT 是什么样的?
-
Rishe,我有一个很大的 xslt 和其他场景。这个场景是我的 xslt 的一部分。
-
我正在使用 xslt 1.0 和 Visual Studio 编辑器。
-
你的输入真的像你的例子吗?在 cdata 中转义 html?也许这会有所帮助:stackoverflow.com/questions/2067116/…
-
@hr_117 是的。看起来一样。