Tôi có tập tin XML này:Giải nén một tập hợp con của tập tin XML sử dụng XSL
<Response>
<errorCode>error Code</errorCode>
<errorMessage>msg</errorMessage>
<ResponseParameters>
<className>
<attribute1>a</attribute1>
<attribute2>b</attribute2>
</className>
</ResponseParameters>
</Response>
Và tôi muốn đầu ra là:
<className>
<attribute1>a</attribute1>
<attribute2>b</attribute2>
</className>
tập tin XSL hiện tại của tôi là bao gồm cũng "ResponseParameters" tag mà tôi không muốn.
EDIT: lưu ý rằng tên lớp node là động. Tôi không biết tên này sẽ là gì khi chạy.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output indent="yes" />
<xsl:template match="/">
<xsl:copy-of select="//ResponseParameters">
</xsl:copy-of>
</xsl:template>
</xsl:stylesheet>