2013-04-16 15 views

回答

1

因此,如果我理解正確,您希望在輸入的子樹上執行XSLT(基於身份轉換),並從結果中忽略該子樹外的所有內容?如果是這樣,你可以這樣做:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:output method="xml" indent="yes"/> 

    <xsl:template match="@* | node()"> 
    <xsl:copy> 
     <xsl:apply-templates select="@* | node()"/> 
    </xsl:copy> 
    </xsl:template> 

    <xsl:template match="/"> 
    <xsl:apply-templates select="/path/to/subtree" /> 
    </xsl:template> 

    <!-- Other templates --> 
</xsl:stylesheet> 
+0

哇,你說得對。我是這麼想的。謝謝。 –