2017-08-30 53 views
0

我有下面的xslt,其中ID和LASTNAME是输入参数。当ID与VW_JAX_EMP_JOB_DEPTRECORDSELECT中的EMPLOYEE_ID匹配时,将Last_Name元素设置为s0:PREFERREDLASTNAME,否则将输入参数设置为LASTNAME。下面一个不起作用。带测试的XSLT和其他

<xsl:template name="GetLastNameVW_JAX_EMP_JOB_DEPT"> 
    <xsl:param name="ID" /> 
    <xsl:param name = "LASTNAME" /> 
    <xsl:element name="Last_Name"> 
    <xsl:choose> 
     <xsl:when test="//s0:VW_JAX_EMP_JOB_DEPTRECORDSELECT[s0:EMPLOYEE_ID = $ID]/s0:PREFERREDLASTNAME"> 
     <xsl:value-of select="//s0:VW_JAX_EMP_JOB_DEPTRECORDSELECT[s0:EMPLOYEE_ID = $ID]/s0:PREFERREDLASTNAME" /> 
     </xsl:when> 
     <xsl:otherwise> LASTNAME 
     </xsl:otherwise> 
    </xsl:choose> 
    </xsl:element> 
</xsl:template> 

任何人都可以请建议我浩在这里设置其他标记。

+0

在'的',它应该是'$ LASTNAME'。如果这是输出中的期望值,那么'$'缺失。 –

回答

1

如果我不missunderstand你的意图,我beliveve您正在寻找

<xsl:value-of select="$LASTNAME"/> 

或者,如果姓是更复杂的

<xsl:copy-of select="$LASTNAME"/> 

W3school Value ofW3School Copy of