<target>
<relatedTarget>
<status>pass</status>
<permitExpiry>2005-08-02T08:11:00.000Z</permitExpiry>
<permitStart>2015-07-11T09:22:00.000Z</permitStart>
</relatedTarget>
<relatedTarget>
<status>fail</status>
<permitExpiry>2003-09-12T08:11:00.000Z</permitExpiry>
<permitStart>2014-04-01T09:22:00.000Z</permitStart>
</relatedTarget>
<relatedTarget>
<status>pass</status>
<permitExpiry>2002-07-10T08:11:00.000Z</permitExpiry>
<permitStart>2016-05-06T09:22:00.000Z</permitStart>
</relatedTarget>
</target>
我希望最终输出为
<target>
<relatedTarget>
<status>pass</status>
<permitExpiry>2005-08-02T08:11:00.000Z</permitExpiry>
<permitStart>2015-05-11T09:22:00.000Z</permitStart>
</relatedTarget>
</target>
输出应包含最小开始日期(不包括relatedTarget中status = fail的日期)和最大结束日期(不包括相关目标中status = fail的日期),可以从上面的值中看出。 此问题的修改版本:Sorting in xslt and choosing minimum or maximum value