我是XSL转换的新手。我在哪里尝试使用XSLT提取XML的一部分。
源XML
<tree>
<trunk>
<branch>
<leaves></leaves>
<flowers></flowers>
<fruits></fruits>
</branch>
</trunk>
</tree>
Run Code Online (Sandbox Code Playgroud)
我期望以下XML作为输出
<root>
<branch>
<leaves></leaves>
<flowers></flowers>
<fruits></fruits>
</branch>
</root>
Run Code Online (Sandbox Code Playgroud)
请提供转换,我长期以来一直在做一些随机的事情。
<xsl:template match="/tree/trunk/branch">
<root>
<xsl:copy-of select="."/>
</root>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1627 次 |
| 最近记录: |