-1
執行XSL,得到一個錯誤之後:XSL錯誤:一個xsl:template元素不能包含一個xsl:template元素
because of: An xsl:template element must not contain an xsl:template element; SystemID: file:/C:/xslt/CombineToOutput.xsl; Line#: 19; Column#: -1 Element must be used only at top level of stylesheet; SystemID: file:/C:/xslt/CombineToOutput.xsl; Line#: 19; Column#: -1 (Failed to compile stylesheet. 2 errors detected.) (Failed to compile stylesheet. 2 errors detected.)
的XSLT
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.openapplications.org/oagis/9">
<!-- STICKER INFO COMBINETOOUTPUT-->
<xsl:template match="/">
<xsl:apply-templates select="child::node()/*[name()!='DbResponse']"/>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*:PurchaseOrder">
<xsl:apply-templates select="*:PurchaseOrderLine/Item/CustomerItemID/ID"/>
<xsl:template match="*:PurchaseOrderLine/Item/CustomerItemID/ID">
<xsl:variable name="ArtNr" select="/*/ProcessPurchaseOrder/DataArea/PurchaseOrder/PurchaseOrderLine/Item/CustomerItemID/ID"/>
<xsl:variable name="WepNr" select="/*/DbResponse/ResultSet/Row[Cell[@name='ARTNR']=$ArtNr]/Cell[@name='WEPNR']"/>
<xsl:copy>
<xsl:if test="$WepNr!=''">
<LineNumber><xsl:value-of select="$WepNr"/></LineNumber>
</xsl:if>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
我在這裏遇到麻煩,理解爲什麼你不能理解這個錯誤信息,這個答案的狀態非常清楚。 – 2012-09-30 10:58:23