试图从日期变量中提取月份,然后基于该数字,用硬编码值填充一个单独的字段。例: 如果日期变量(生效日期)的月份为'1'(1/23/2019),则将END DATE设置为'2/19/2019'。
我已经能够将错误范围缩小到cannot compare xs:integer to xs:string
<bsvc:End_Date>
<xsl:choose>
<xsl:when test="month-from-date(xs:date('$effectiveDate')) = '1'">
<xsl:text>2/19/2019</xsl:text>
</xsl:when>
</bsvc:End_Date>
答案 0 :(得分:0)
如果$effectiveDate
包含有效日期,则使用以下表达式:
<xsl:when test="month-from-date($effectiveDate) = 1">
(请注意,没有引号的情况)将在$effectiveDate
的月份为一月时返回true。