現在、XML からのフレームの総数を処理しています。私がやろうとしているのは、これを一定の時間で変換することです。fps が 30 であることはわかっています。フレームの総数を正しく計算し、これを秒に変換しました。私が今やろうとしているのは、この合計秒数を hh:mm:ss 形式で変更することです。
これが私のコードにあるものです:
<!-- call in template time-calc and then divid by 30fps to calulate total seconds of time-->
<xsl:variable name="TotalDurationShow"><xsl:call-template name="time-calculation"></xsl:call-template></xsl:variable>
<xsl:variable name="TotalSeconds" select="$TotalDurationShow div 30"/>
<!-- Time-in-seconds to time in hh:mm:ss.000 form-->
<xsl:template name="secondsToTime">
<xsl:param name="seconds" />
<xsl:variable name="partHours" select="floor($seconds div 60 div 60)" />
<xsl:variable name="partMinutes" select="floor(($seconds - ($partHours * 60 * 60)) div 60)" />
<xsl:variable name="partSeconds" select="$seconds - ($partHours * 60 * 60) - ($partMinutes * 60)" />
<xsl:value-of select="concat(substring('0', 1, 2 - string-length(string( $partHours ))), $partHours)" /><xsl:text>:</xsl:text>
<xsl:value-of select="concat(substring('0', 1, 2 - string-length(string( $partMinutes ))), $partMinutes)" /><xsl:text>:</xsl:text>
<xsl:value-of select="concat(substring('0', 1, 2 - string-length(string( $partSeconds ))), $partSeconds)" />
</xsl:template>
<!-- test to make sure this is a number value in for total seconds
call in template secondstotime on totalseconds variable to convert to time code formate hh:mm:ss-->
<xsl:if test="$TotalSeconds != 0 and string(number($TotalSeconds)) != 'NaN'">
<xsl:variable name="TimeFrame"><xsl:call-template name="secondsToTime"><xsl:with-param name="seconds" select="$TotalSeconds" /></xsl:call-template></xsl:variable>
</xsl:if>
xsl:if をスプレッド シートの子にすることはできないというエラー メッセージが表示されます。if のテストを削除すると、param seconds が定義されていないというエラー メッセージが表示されます。変数 totalseconds でテンプレート secondstotime を呼び出すときに、何か間違ったことをしていますか?