-4

我有一个 xslt 代码以 XML 的形式将数据发送到第三方系统。我需要为全职员工填写“Y”,为兼职员工填写“N”。

这是我的 xslt

在此处输入图像描述

这是我的xml数据

在此处输入图像描述

4

1 回答 1

0

The value in the variable $Emp_type by the below code will be Full_time.

<xsl:variable name="Emp_type" select="wd:Position_Time_Type/wd:ID[@wd:type='Position_Time_Type_ID']" />

Below condition

<xsl:when test="$Emp_type = 'Y'">

should be modified to

<xsl:when test="$Emp_type = 'Full_time'">

Below is the modified code.

<xsl:variable name="Emp_type" select="wd:Position_Time_Type/wd:ID[@wd:type='Position_Time_Type_ID']" />
<xsl:variable name="Emp_type_FT">
    <xsl:choose>
        <xsl:when test="$Emp_type = 'Full_time'">
            <xsl:value-of select="'Y'" />
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="'N'" />
        </xsl:otherwise>
    </xsl:choose>
</xsl:variable>
于 2017-10-12T05:22:43.380 回答