Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xslt XSL中的缺勤更改不';我跑不好_Xslt - Fatal编程技术网

Xslt XSL中的缺勤更改不';我跑不好

Xslt XSL中的缺勤更改不';我跑不好,xslt,Xslt,获取了以下错误: 未为类型的参数定义算术运算符 (xs:dateTime,xs:string) 有人能帮我吗?我正在试着改变缺勤情况 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="urn:this" xmlns:is="java:com.workday.esb.in

获取了以下错误:

未为类型的参数定义算术运算符 (xs:dateTime,xs:string)

有人能帮我吗?我正在试着改变缺勤情况

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="urn:this"
        xmlns:is="java:com.workday.esb.intsys.xpath.ParsedIntegrationSystemFunctions"
        xmlns:tv="java:com.workday.esb.intsys.TypedValue" xmlns:wd="urn:com.workday/bsvc"
        xmlns:bsvc="urn:com.workday/bsvc" exclude-result-prefixes="xs is tv wd bsvc"
        version="2.0">

        <xsl:variable name="linefeed" select="'&#xA;'" />

        <xsl:output method="text" />

        <xsl:template match="/">
            <xsl:variable name="StdHoursMultiplier" select="26" />

            <xsl:if
                test="wd:Payee/wd:Payee_Status_Data/wd:Terminated = '0' and not(wd:Payee/wd:Payee_Status_Data/wd:Leave_Status_Data/wd:On_Leave = '1') and not(exists(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type = 'Contingent_Worker_ID']))">

                <xsl:if
                    test="wd:Payee/wd:Payee_Job_Data/wd:Payee_Employment_Data/wd:Position_Data/wd:Job_Exempt != '0'">

                    <xsl:value-of select="this:right-padding(5,' ','TW')" />

                    <!-- employee id -->
                    <xsl:value-of
                        select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                    <!-- earning code -->
                    <xsl:value-of select="this:right-padding(6,' ','RGL')" />

                    <!-- amount type -->
                    <xsl:value-of select="this:right-padding(4,' ','H')" />

                    <!-- text -->
                    <xsl:value-of select="this:right-padding(7,' ','1')" />

                    <!-- amount -->
                    <xsl:value-of
                        select="this:left-padding(8,' ',format-number((number(wd:Payee/wd:Payee_Job_Data/wd:Payee_Employment_Data/wd:Position_Data/wd:Scheduled_Weekly_Hours)*52) div $StdHoursMultiplier,'####.00') )" />

                    <!-- line feed -->
                    <xsl:value-of select="$linefeed" />

                </xsl:if>
            </xsl:if>
            <xsl:for-each
                select="//wd:Payee_Earnings_and_Deductions_Summary_Data/wd:Payee_One_Time_Payments_Summary_Data/wd:Payee_One_Time_Payment_Summary_Data/wd:Payee_One_Time_Payment_Data">

                <xsl:value-of select="this:right-padding(5,' ','SP')" />

                <!-- employee id -->
                <xsl:value-of
                    select="this:right-padding(11,' ',substring(/wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                <!-- earning code -->
                <xsl:value-of select="this:right-padding(6,' ',../wd:External_Payroll_Code)" />

                <!-- amount type -->
                <xsl:value-of select="this:right-padding(4,' ','D')" />

                <!-- text -->
                <xsl:value-of select="this:right-padding(7,' ','1')" />

                <!-- amount -->
                <xsl:value-of
                    select="this:left-padding(10,' ',format-number(sum(wd:Amount/wd:Value),'####.00'))" />

                <!-- line feed -->
                <xsl:value-of select="$linefeed" />
            </xsl:for-each>

            <xsl:if
                test="wd:Payee/wd:Payee_Status_Data/wd:Terminated = '0' and (wd:Payee/wd:Payee_Status_Data/wd:Leave_Status_Data/wd:On_Leave = '1') and not(exists(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type = 'Contingent_Worker_ID']))">

                <xsl:if
                    test="wd:Payee/wd:Payee_Job_Data/wd:Payee_Employment_Data/wd:Position_Data/wd:Job_Exempt != '0'"
                    exclude-result-prefixes="#all">
                    <xsl:choose>
                        <xsl:when
                            test="wd:Payee//wd:Payee_Status_Data/wd:Leave_Status_Data/wd:Paid_Time_off_Accrual_Effect = '1'">
                            <xsl:value-of select="this:right-padding(5,' ','TW')" />

                            <!-- employee id -->
                            <xsl:value-of
                                select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                            <!-- earning code -->
                            <xsl:value-of select="this:right-padding(6,' ','RGL')" />

                            <!-- amount type -->
                            <xsl:value-of select="this:right-padding(4,' ','H')" />

                            <!-- text -->
                            <xsl:value-of select="this:right-padding(7,' ','1')" />

                            <!-- amount -->
                            <xsl:variable name="LeaveHours"
                                select="xs:dateTime(wd:Payee/wd:Payee_Status_data/wd:leave_Status_Data/wd:Estimated_Leave_End_Date) - xs:dateTime(wd:Payee/wd:Payee_Status_data/wd:leave_Status_Data/wd:Leave_Start_Date)cast as xs:string" />

                            <!-- amount -->


                            <xsl:value-of
                                select="this:left-padding(8,' ', '80')" />

                            <!-- line feed -->
                            <xsl:value-of select="$linefeed" />
                            <xsl:value-of select="this:right-padding(5,' ','TW')" />

                            <!-- employee id -->
                            <xsl:value-of
                                select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                            <!-- earning code -->


                            <xsl:value-of select="this:right-padding(6,' ','SDP')" />


                            <!-- amount type -->
                            <xsl:value-of select="this:right-padding(4,' ','H')" />

                            <!-- text -->
                            <xsl:value-of select="this:right-padding(7,' ','1')" />
                            <!-- amount -->


                            <!-- amount -->
                            <xsl:value-of
                                select="this:left-padding(8,' ',format-number(number(substring-before(substring-after($LeaveHours,'P'),'D')),'####.00'))" />

                        </xsl:when>
                        <xsl:when
                            test="not(wd:Payee//wd:Payee_Status_Data/wd:Leave_Status_Data/wd:Paid_Time_off_Accrual_Effect = '1')">
                            <xsl:value-of select="this:right-padding(5,' ','TW')" />

                            <!-- employee id -->
                            <xsl:value-of
                                select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                            <!-- earning code -->
                            <xsl:value-of select="this:right-padding(6,' ','RGL')" />

                            <!-- amount type -->
                            <xsl:value-of select="this:right-padding(4,' ','H')" />

                            <!-- text -->
                            <xsl:value-of select="this:right-padding(7,' ','1')" />

                            <!-- amount -->

                            <!-- amount -->
                            <!-- amount -->
                            <xsl:variable name="LeaveHours"
                                select="xs:dateTime(wd:Payee/wd:Payee_Status_data/wd:leave_Status_Data/wd:Estimated_Leave_End_Date) - xs:dateTime(wd:Payee/wd:Payee_Status_data/wd:leave_Status_Data/wd:Leave_Start_Date) cast as xs:string" />


                            <xsl:value-of
                                select="this:left-padding(8,' ',format-number(number(substring-before(substring-after($LeaveHours,'P'),'D')),'####.00' ))" />


                            <!-- line feed -->
                            <xsl:value-of select="$linefeed" />
                            <xsl:value-of select="this:right-padding(5,' ','TW')" />

                            <!-- employee id -->
                            <xsl:value-of
                                select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                            <!-- earning code -->


                            <xsl:value-of select="this:right-padding(6,' ','SDP')" />


                            <!-- amount type -->
                            <xsl:value-of select="this:right-padding(4,' ','H')" />

                            <!-- text -->
                            <xsl:value-of select="this:right-padding(7,' ','1')" />
                            <!-- amount -->
                            <!-- amount -->

                            <xsl:value-of select="this:left-padding(8,' ','0')" />

                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="this:right-padding(5,' ','TW')" />

                            <!-- employee id -->
                            <xsl:value-of
                                select="this:right-padding(11,' ',substring(wd:Payee/wd:Payee_Reference/wd:ID[@wd:type='Employee_ID']/text(),3,6))" />

                            <!-- earning code -->
                            <xsl:value-of select="this:right-padding(6,' ','SDP')" />

                            <!-- amount type -->
                            <xsl:value-of select="this:right-padding(4,' ','H')" />

                            <!-- text -->
                            <xsl:value-of select="this:right-padding(7,' ','1')" />

                            <!-- amount -->
                            <xsl:value-of
                                select="this:left-padding(8,' ',format-number((number(wd:Payee/wd:Payee_Job_Data/wd:Payee_Employment_Data/wd:Position_Data/wd:Scheduled_Weekly_Hours)*52) div $StdHoursMultiplier,'####.00') )" />

                        </xsl:otherwise>

                    </xsl:choose>


                </xsl:if>
                <!-- line feed -->
                <xsl:value-of select="$linefeed" />
            </xsl:if>

        </xsl:template>

        <xsl:function name="this:right-padding">
            <xsl:param name="length" as="xs:integer" />
            <xsl:param name="padChar" as="xs:string" />
            <xsl:param name="stringToPad" />

            <xsl:sequence
                select="substring(string-join(($stringToPad, for $i in (1 to $length) return $padChar),''),1,$length)" />

        </xsl:function>


        <xsl:function name="this:left-padding" as="xs:string">
            <xsl:param name="length" as="xs:integer" />
            <xsl:param name="padChar" as="xs:string" />
            <xsl:param name="stringToPad" />
            <xsl:choose>
                <xsl:when test="string-length($stringToPad) &gt; $length">
                    <xsl:sequence
                        select="substring($stringToPad, string-length($stringToPad) - $length + 1, $length)" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:sequence
                        select="substring(string-join((for $i in (1 to $length - string-length($stringToPad)) return $padChar, $stringToPad),''),1,$length)" />
                </xsl:otherwise>
            </xsl:choose>
        </xsl:function>
    </xsl:stylesheet>

代码
应该会导致该错误。只需删除尾部的
强制转换为xs:string
,这样您就可以使用减号运算符
-
减去两个
xs:dateTime
值,并获得一个持续时间值,您可以根据需要进一步处理。

请将代码减少到最小值,以便我们重现错误。告诉我们哪一行给出了错误?这是不是xs:dateTime(wd:paye/wd:paye\u Status\u data/wd:leave\u Status\u data/wd:Estimated\u leave\u End\u Date)-xs:dateTime(wd:paye/wd:paye\u Status\u data/wd:leave\u Start\u data)强制转换为xs:string?请尝试删除转换为xs:string的
。这不是紧急支持站点,非常紧急。耐心点,也许你会得到答案。。。