【发布时间】:2016-12-12 16:45:10
【问题描述】:
我有以下带有 cdata 标记的 XML,我想从中提取文本?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<cus:TestData xmlns:cus="http://test.namespace.com/data">
<![CDATA[testValue]]></cus:TestData >
如何在 XSLT 中实现这一点?
我正在短暂尝试以下内容
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
"<xsl:value-of select="/*/Name"/>"
</xsl:template>
</xsl:stylesheet>
但它似乎不起作用
此外,XML 也没有相同的前缀或命名空间,它会发生变化
【问题讨论】: