是的,它很容易接近,看看:
XML:
<body>
<RIAssetType><text>Product</text></RIAssetType>
<RIAssetType><text>Service</text></RIAssetType>
<RIAssetType><text>Company/Business Unit</text></RIAssetType>
<RIAssetType><text>Technology</text></RIAssetType>
<RIAssetType><text>Intellectual Property/Data Only</text></RIAssetType>
</body>
XSLT:
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="body">
<copyBody>
<xsl:call-template name="childCopy">
<xsl:with-param name="bodyChild" select="self::body/child::*"/>
</xsl:call-template>
</copyBody>
</xsl:template>
<xsl:template name="childCopy">
<xsl:param name="bodyChild"/>
<xsl:for-each select="$bodyChild/self::*">
<xsl:copy>
<xsl:copy-of select="."/>
</xsl:copy>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
输出:
<copyBody>
<RIAssetType>
<RIAssetType>
<text>Product</text>
</RIAssetType>
</RIAssetType>
<RIAssetType>
<RIAssetType>
<text>Service</text>
</RIAssetType>
</RIAssetType>
<RIAssetType>
<RIAssetType>
<text>Company/Business Unit</text>
</RIAssetType>
</RIAssetType>
<RIAssetType>
<RIAssetType>
<text>Technology</text>
</RIAssetType>
</RIAssetType>
<RIAssetType>
<RIAssetType>
<text>Intellectual Property/Data Only</text>
</RIAssetType>
</RIAssetType>
</copyBody>
看来您在某处的 XPATH 中有 struct,请再次检查。