我有一个BizTalk表达式形状的Xpath代码,它返回此错误:
'min(/ [local-name()='EmployeeUDM_Response'和namespace-uri()='http://Securitas/ESB/Schemas/v2/EmployeeUDM'] / [local-name()='Return'] / [local-name()='Employee'] / [local-name()='Contracts'] / [local-name()='Contract'] / [local-name()='EmployementStartDate'] / xs:dateTime(。))'具有无效的令牌。
我之前几次得到这个错误,但那是因为我走了一条糟糕的道路
Xpath代码:
xpath("min(/*[local-name()='EmployeeUDM_Response' and namespace-uri()='http://Securitas/ESB/Schemas/v2/EmployeeUDM']/*[local-name()='Return']/*[local-name()='Employee']/*[local-name()='Contracts']/*[local-name()='Contract']/*[local-name()='EmployementStartDate']/xs:dateTime(.))")
XML文件:
- <Employee date="date_0" rostarproject="rostarproject_1" xmlns:ns0="http://Securitas.ESB.HR.EmployeeUDMToRostar.MDSRequest_Schema">
<UPN>UPN_0</UPN>
<SAMAccountName>SAMAccountName_0</SAMAccountName>
<Number>Number_0</Number>
<SagaNumber>SagaNumber_0</SagaNumber>
<SurNameFull>SurNameFull_0</SurNameFull>
<FirstName>FirstName_0</FirstName>
<GivenName>GivenName_0</GivenName>
<Gender>Gender_0</Gender>
<DateOfBirth>DateOfBirth_0</DateOfBirth>
<EmailPrivate>EmailPrivate_0</EmailPrivate>
<PhoneMobilePrivate>PhoneMobilePrivate_0</PhoneMobilePrivate>
<PhonePrivate>PhonePrivate_0</PhonePrivate>
<EmployementStartDate>EmployementStartDate_0</EmployementStartDate>
<EmployementEndDate>EmployementEndDate_0</EmployementEndDate>
- <Contracts>
- <Contract>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Type>Type_0</Type>
<DissimelarCAO>DissimelarCAO_0</DissimelarCAO>
<PhaseID>PhaseID_0</PhaseID>
<PB_CAO>PB_CAO_0</PB_CAO>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Type>Type_0</Type>
<DissimelarCAO>DissimelarCAO_0</DissimelarCAO>
<PhaseID>PhaseID_0</PhaseID>
<PB_CAO>PB_CAO_0</PB_CAO>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Type>Type_0</Type>
<DissimelarCAO>DissimelarCAO_0</DissimelarCAO>
<PhaseID>PhaseID_0</PhaseID>
<PB_CAO>PB_CAO_0</PB_CAO>
</Contract>
</Contracts>
- <Functions>
- <Function>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Position>Position_0</Position>
<CostCenterCode>CostCenterCode_0</CostCenterCode>
<CostCenter>CostCenter_0</CostCenter>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Position>Position_0</Position>
<CostCenterCode>CostCenterCode_0</CostCenterCode>
<CostCenter>CostCenter_0</CostCenter>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<Position>Position_0</Position>
<CostCenterCode>CostCenterCode_0</CostCenterCode>
<CostCenter>CostCenter_0</CostCenter>
</Function>
</Functions>
- <Adresses>
- <Adress>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<StreetNumber>StreetNumber_0</StreetNumber>
<StreetNumberAddition>StreetNumberAddition_0</StreetNumberAddition>
<Street>Street_0</Street>
<ZipCode>ZipCode_0</ZipCode>
<City>City_0</City>
<Country>Country_0</Country>
<Type>Type_0</Type>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<StreetNumber>StreetNumber_0</StreetNumber>
<StreetNumberAddition>StreetNumberAddition_0</StreetNumberAddition>
<Street>Street_0</Street>
<ZipCode>ZipCode_0</ZipCode>
<City>City_0</City>
<Country>Country_0</Country>
<Type>Type_0</Type>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<StreetNumber>StreetNumber_0</StreetNumber>
<StreetNumberAddition>StreetNumberAddition_0</StreetNumberAddition>
<Street>Street_0</Street>
<ZipCode>ZipCode_0</ZipCode>
<City>City_0</City>
<Country>Country_0</Country>
<Type>Type_0</Type>
</Adress>
</Adresses>
- <Wages>
- <Wage>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<DissimelarZipCode>DissimelarZipCode_0</DissimelarZipCode>
<MAXKM>MAXKM_0</MAXKM>
<RightTravelHours>RightTravelHours_0</RightTravelHours>
<RightTravelExpense>RightTravelExpense_0</RightTravelExpense>
<RightAdditions>RightAdditions_0</RightAdditions>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<DissimelarZipCode>DissimelarZipCode_0</DissimelarZipCode>
<MAXKM>MAXKM_0</MAXKM>
<RightTravelHours>RightTravelHours_0</RightTravelHours>
<RightTravelExpense>RightTravelExpense_0</RightTravelExpense>
<RightAdditions>RightAdditions_0</RightAdditions>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<DissimelarZipCode>DissimelarZipCode_0</DissimelarZipCode>
<MAXKM>MAXKM_0</MAXKM>
<RightTravelHours>RightTravelHours_0</RightTravelHours>
<RightTravelExpense>RightTravelExpense_0</RightTravelExpense>
<RightAdditions>RightAdditions_0</RightAdditions>
</Wage>
</Wages>
- <Roosters>
- <Rooster>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<WeekAmountOfHours>WeekAmountOfHours_0</WeekAmountOfHours>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<WeekAmountOfHours>WeekAmountOfHours_0</WeekAmountOfHours>
<StartDate>StartDate_0</StartDate>
<EndDate>EndDate_0</EndDate>
<WeekAmountOfHours>WeekAmountOfHours_0</WeekAmountOfHours>
</Rooster>
</Roosters>
</ns0:Employee>
我期望用最早的'EmployementStartDate'输出XML
min()
可以在XPath 2.0中使用,但不能在XPath 1.0中使用(尽管它可能在Biztalk中可用吗?)
你需要在任何地方将/[local-name()='x']
改为/*[local-name()='x']
。
构造XXX/xs:date-time(.)
也需要XPath 2.0。