InqScribe exports XML that looks like this:
<transcript> <prologue> </prologue> <scene id="1" in="00:00:00.00" out="00:01:00.00">Line 1.</scene> <scene id="2" in="00:01:15.00" out="00:03:00.00">Line 2</scene> </transcript>
But sometimes you may want to convert this XML to another format, like this:
<myformat>
<transcript>
<start>00:00:00.00</start>
<end>00:01:00.00</end>
<text>Line 1.</text>
</transcript>
<transcript>
<start>00:01:15.00</start>
<end>00:03:00.00</end>
<text>Line 2.</text>
</transcript>
</myformat>
You can do this fairly easily using a technology called XSLT. We won’t go into XSLT in depth here. If you want to read up on XSLT, try these starting points:
Here are a couple of good, free XSLT processors you can use to do the actual conversion.
Now for the good stuff. Here’s an example XSLT file that will convert the sample XML output above into the desired “myformat”.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<myformat>
<xsl:for-each select="//scene">
<transcript>
<start><xsl:value-of select="@in"/></start>
<end><xsl:value-of select="@out"/></end>
<text><xsl:value-of select="."/></text>
</transcript>
</xsl:for-each>
</myformat>
</xsl:template>
</xsl:stylesheet>
A few comments about this example:
<item a=”00:00:00.00” b=”00:01:00.00”/>, you’d use this XSLT code: <item a=”{@in}” b=”{@out}”/>. Hopefully this makes InqScribe’s XML output even more useful to you.
Questions or comments on this page? Send us a note.