给定以下 XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<report>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?><whatever><title>GREETING</title><greeting>Hi</greeting><name>Dave</name></whatever>]]>
</report>
</root>
如何使用 XSL-T 来考虑这种“嵌入式”XML?
XSL-Transformations 之后我想获得的示例输出如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<TransformedRoot>
<data><html><head><title>GREETING</title></head><body><p>Hi, Dave!</p></body></html>
</TransformedRoot>
假设这是我正在使用的标准 XSL-T:
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="/root">
<TransformedRoot>
<data><!-- How do I get the elements here? --></data>
</TransformedRoot>
</xsl:template>