我想使用xslt删除内部节点。
投入:
<row>
<entry align="left" namest="3" valign="middle">
<p type="Table Head">
<c type="_Table Green grid ALL">Medium–low</c>
</p>
</entry>
</row>产出应是:
<row>
<entry align="left" namest="3" valign="middle">
<p type="Table Head">
Medium–low
</p>
</entry>
</row>我使用<xsl:copy-of>来执行这个操作。但它与<c>复制。
我想要做的是删除<c>节点。我正在使用XSLT2.0
发布于 2019-08-06 04:44:10
试试看
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="c">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>https://stackoverflow.com/questions/57368897
复制相似问题