Xml 持续时间计算

Xml 持续时间计算,xml,xslt,Xml,Xslt,我有以下时间段 <EstimatedTime> <Value>PT0H3M05S</Value> </EstimatedTime> 预期产量为 03.05 如果您的处理器支持XSLT 2.0,您可以使用: <xsl:template match="EstimatedTime"> <xsl:value-of select="format-number(minutes-from-duration(Value), '00'

我有以下时间段

<EstimatedTime>
  <Value>PT0H3M05S</Value>
</EstimatedTime>
预期产量为

03.05


如果您的处理器支持XSLT 2.0,您可以使用:

<xsl:template match="EstimatedTime">
    <xsl:value-of select="format-number(minutes-from-duration(Value), '00')"/>
    <xsl:text>.</xsl:text>
    <xsl:value-of select="format-number(seconds-from-duration(Value), '00')"/>
</xsl:template>

您需要使用xslt字符串函数解析字符串。。。通过搜索找到解决方案: