我的xml是:
<content type="text/html" title="flow-active-timeout">
<body>
<dl>
</dl>
<p> </p>
<div mt-section-origin="Product_Documentation/Command_Reference/Configuration_Commands/flow-active-timeout" class="mt-section" id="section_1"><span id="vManage_Feature_Template"></span><h2 class="editable">vManage Feature Template</h2>
<p>For vSmart controllers:</p>
<p>Configuration ► Policies ► Centralized Policy</p>
</div>
</body>我的xslt代码是:
<xsl:template match="*[not(normalize-space(translate(., ' ', ' ')))]"/>但是它只删除空的<p>标记,而不删除<dl>标记
使用上述xslt的输出:
<body>
<dl/>
<div mt-section-origin="Product_Documentation/Command_Reference/Configuration_Commands/flow-active-timeout" class="mt-section" id="section_1"><span id="vManage_Feature_Template"></span><h2 class="editable">vManage Feature Template</h2>
<p>For vSmart controllers:</p>
<p>Configuration ► Policies ► Centralized Policy</p>
</div>
</body>预期输出为:
<body>
<div mt-section-origin="Product_Documentation/Command_Reference/Configuration_Commands/flow-active-timeout" class="mt-section" id="section_1"><span id="vManage_Feature_Template"></span><h2 class="editable">vManage Feature Template</h2>
<p>For vSmart controllers:</p>
<p>Configuration ► Policies ► Centralized Policy</p>
</div>
</body>请提供一些语句来实现预期的输出
发布于 2019-01-31 16:49:18
<xsl:template match="*[text()=' ' or normalize-space(.)='']"/>
You may also use like thishttps://stackoverflow.com/questions/54456053
复制相似问题