Fix NTSB feed and add OPML version for JSON

This commit is contained in:
Lucidiot 2021-03-17 23:48:12 +01:00
parent e7398b9b6f
commit b94c949906
Signed by: lucidiot
GPG Key ID: 3358C1CA6906FB8D
2 changed files with 17 additions and 12 deletions

View File

@ -30,7 +30,7 @@
<type>Road, rail, aviation, marine, pipeline</type>
<frequency>100 reports/year</frequency>
<feed lang="English" format="rss" id="ntsb-rss">
<link>https://www.ntsb.gov/_layouts/feed.aspx?xsl=1&amp;web=%2F&amp;page=674e62a9-4f3b-4058-846b-150bc1c21aa0&amp;wp=4d4ae30f-92c9-4e6c-9c58-6bac99822531</link>
<link>https://www.ntsb.gov/_layouts/15/feed.aspx?xsl=1&amp;web=%2F&amp;page=674e62a9-4f3b-4058-846b-150bc1c21aa0&amp;wp=4d4ae30f-92c9-4e6c-9c58-6bac99822531</link>
</feed>
</source>

View File

@ -78,17 +78,22 @@
<xsl:value-of select="translate(@lang, $upper, $lower)" />
</xsl:attribute>
<xsl:attribute name="type">rss</xsl:attribute>
<xsl:choose>
<xsl:when test="@format = 'rss'">
<xsl:attribute name="version">RSS</xsl:attribute>
</xsl:when>
<xsl:when test="@format = 'atom'">
<xsl:attribute name="version">ATOM</xsl:attribute>
</xsl:when>
<xsl:when test="@format = 'rdf'">
<xsl:attribute name="version">RSS1</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:attribute name="version">
<xsl:choose>
<xsl:when test="@format = 'rss'">
<xsl:text>RSS</xsl:text>
</xsl:when>
<xsl:when test="@format = 'atom'">
<xsl:text>ATOM</xsl:text>
</xsl:when>
<xsl:when test="@format = 'rdf'">
<xsl:text>RSS1</xsl:text>
</xsl:when>
<xsl:when test="@format = 'json'">
<xsl:text>JSON</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="xmlUrl">
<xsl:choose>
<xsl:when test="./itsb:output">