New importer, Nat. Geo. Wild.
[nonametv.git] / tools / no / nonametv-import-svt
blob3197ce8cc84b14902260d499e1cf6fc7bd3f5620
1 #!/bin/bash
3 if [ "x$1" == "x" ]; then
4 echo "nonametv-import-svt <xmlfile>"
5 echo
6 echo "Import a datafile from Svt into the nonametv database."
7 echo
8 exit
9 fi
11 awk 'BEGIN { p=0 } /^</ {p=1} p==1 {print}' $0 | xsltproc - $1 | nonametv-import Svt
12 exit
13 <?xml version="1.0" encoding="iso-8859-1"?>
14 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
16 <xsl:output method="xml" indent="no"/>
18 <xsl:template match="schedule">
19 <schedule>
20 <xsl:copy-of select="@*"/>
21 <xsl:apply-templates/>
22 </schedule>
23 </xsl:template>
25 <xsl:template match="programs">
26 <programs>
27 <xsl:copy-of select="@*"/>
28 <xsl:apply-templates select="program">
29 <xsl:sort select="normalize-space(week_number/text())"/>
30 <xsl:sort select="normalize-space(channel/text())"/>
31 </xsl:apply-templates>
32 </programs>
33 </xsl:template>
35 <xsl:template match="*">
36 <xsl:copy-of select="."/>
37 </xsl:template>
39 </xsl:stylesheet>