【发布时间】:2017-10-23 12:04:49
【问题描述】:
我的输入 XML 如下所示,
<part type="content">
<part type="content">
<title>PART IFundamentals and Basics</title>
................
</part>
<part type="content">
<title>PART IISkin and Soft Tissue</title>
................
</part>
<part type="content">
<title>PART IIIHead and Neck<target id="p003"/><target id="page215"/></title>
................
</part>
</part>
输出应该改变为,
<part type="content">
<title>PART IFundamentals and Basics</title>
................
</part>
<part type="content">
<title>PART IISkin and Soft Tissue</title>
................
</part>
<part type="content">
<title>PART IIIHead and Neck<target id="p003"/><target id="page215"/> </title>
................
</part>
我的 XSLT 是这样的,
<xsl:template match="part[@type='content']/part[@type='content']">
<xsl:apply-templates />
</xsl:template>
在使用上述 xslt 时,“part”元素正在从“Part II”父元素中移除。请您指导我们。
【问题讨论】: