XSLT 有点问题麻烦各位帮忙看看啊
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" version="1.0"/>
<xsl:template match="/">
<xsl:element name="ExpenseList">
<xsl:for-each select="/ExpenseList/Request">
<xsl:variable name="ReqId" select="@ID"/>
<xsl:variable name="DivId" select="@Division"/>
<xsl:variable name="DepId" select="@Department"/>
<xsl:variable name="EmpId" select="@EmployesId"/>
<!--Div>
<xsl:value-of select="$ReqId"/>
<xsl:value-of select="$DivId"/>
</Div-->
<xsl:element name="Request">
<xsl:attribute name="ID"><xsl:value-of select="$ReqId"/></xsl:attribute>
<xsl:attribute name="EmployesId"><xsl:value-of select="$EmpId"/></xsl:attribute>
<xsl:attribute name="Divisiov"><xsl:value-of select="$DivId"/></xsl:attribute>
<xsl:attribute name="Department"><xsl:value-of select="$DepId"/></xsl:attribute>
<xsl:for-each select="/ExpenseList/Request[@ID=$ReqId]/ExpenseItem">
<!--Div>
<xsl:value-of select="$ReqId"/>
</Div-->
<xsl:element name="ExpenseItem">
<xsl:variable name="Type" select="@Type"/>
<xsl:variable name="Quantity" select="@Quantity"/>
<xsl:variable name="AMount" select="@AMount"/>
<xsl:variable name="ExtentedAmt" select="@ExtentedAmt"/>
<xsl:attribute name="Type"><xsl:value-of select="$Type"/></xsl:attribute>
<xsl:attribute name="Quantity"><xsl:value-of select="$Quantity"/></xsl:attribute>
<xsl:attribute name="AMount"><xsl:value-of select="$AMount"/></xsl:attribute>
<xsl:attribute name="ExtentedAmt"><xsl:value-of select="$ExtentedAmt"/></xsl:attribute>
<!--Div>
<xsl:value-of select="concat('==',$DivId)"/>
<xsl:value-of select="concat('==',$DepId)"/>
<xsl:value-of select="concat('==',$EmpId)"/>
</Div-->
<xsl:variable name="adf">
<xsl:call-template name="y">
<xsl:with-param name="Div" select="$DivId"/>
<xsl:with-param name="Dep" select="$DepId"/>
<xsl:with-param name="Emp" select="$EmpId"/>
</xsl:call-template>
</xsl:variable>
<Div>
<xsl:value-of select="$adf - '1'"/>
</Div>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template name="y">
<xsl:param name="Div" />
<xsl:param name="Dep" />
<xsl:param name="Emp" />
<xsl:variable name="ot" select="document('test2.xml')"/>
<xsl:for-each select="$ot/GLAccountDefinition/MainAccountSegment">
<xsl:variable name="Ma" select="@ID"/>
<xsl:choose>
<xsl:when test="$Div!=0">
<xsl:for-each select="$ot/GLAccountDefinition/MainAccountSegment/Division">
<xsl:if test="@ID=$Div">
<xsl:variable name="Acc" select="@AccountSegment"/>
<xsl:choose>
<xsl:when test="$Dep!=0">
<xsl:for-each select="$ot/GLAccountDefinition/MainAccountSegment/Division/DepartMent">
<xsl:if test="@ID=$Dep">
<xsl:variable name="Accd" select="@AccountSegment"/>
<xsl:choose>
<xsl:when test="$Emp!=0">
<xsl:for-each select="$ot/GLAccountDefinition/MainAccountSegment/Division/DepartMent/Employee">
<xsl:if test="@ID=$Emp">
<xsl:variable name="Acce" select="@AccountSegment"/>
<xsl:value-of select="concat($Ma,$Acc,$Accd,$Acce)"/>
<!--Div>
<xsl:value-of select="concat('==',$Div)"/>
<xsl:value-of select="concat('==',$Dep)"/>
<xsl:value-of select="concat('==',$Emp)"/>
</Div-->
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($Ma,$Acc,$Accd)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($Ma,$Acc)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$Ma"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
以上是我的XSLT出问题的地放是调用摸板时不能返回值
<xsl:variable name="adf">
<xsl:call-template name="y">
<xsl:with-param name="Div" select="$DivId"/>
<xsl:with-param name="Dep" select="$DepId"/>
<xsl:with-param name="Emp" select="$EmpId"/>
</xsl:call-template>
</xsl:variable>
<Div>
<xsl:value-of select="$adf - '1'"/>
</Div>