mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2025-12-31 08:50:48 +00:00
Create SRT.xsl
Added XSLT for creating SRT subtitles.
This commit is contained in:
30
ptulsconv/xslt/SRT.xsl
Normal file
30
ptulsconv/xslt/SRT.xsl
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:transform version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:fmp="http://www.filemaker.com/fmpxmlresult">
|
||||
|
||||
<xsl:output method="text" encoding="CP1252"/>
|
||||
<xsl:template match="/">
|
||||
|
||||
<xsl:for-each select="/fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
|
||||
<xsl:sort data-type="number" select="number(fmp:COL[9]/fmp:DATA)" />
|
||||
<xsl:value-of select="concat(position() ,'
')" />
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[9]/fmp:DATA) div 3600),'00'), ':')" />
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[9]/fmp:DATA) div 60),'00'), ':')" />
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[9]/fmp:DATA) mod 60),'00'), ',')" />
|
||||
<xsl:value-of select="format-number((number(fmp:COL[9]/fmp:DATA) - floor(number(fmp:COL[9]/fmp:DATA))) * 1000,'000')" />
|
||||
<xsl:text> --> </xsl:text>
|
||||
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[10]/fmp:DATA) div 3600),'00'), ':')" />
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[10]/fmp:DATA) div 60),'00'), ':')" />
|
||||
<xsl:value-of select="concat(format-number(floor(number(fmp:COL[10]/fmp:DATA) mod 60),'00'), ',')" />
|
||||
<xsl:value-of select="format-number((number(fmp:COL[10]/fmp:DATA) - floor(number(fmp:COL[10]/fmp:DATA))) * 1000,'000')" />
|
||||
|
||||
<xsl:value-of select="concat('
',fmp:COL[15]/fmp:DATA, ': ', fmp:COL[21]/fmp:DATA)"/>
|
||||
<xsl:value-of select="'

'" />
|
||||
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:transform>
|
||||
Reference in New Issue
Block a user