Files
fsfe-website/fsfe.org/news/xhtml2xml.xsl
delliott 1a05dee2f6
All checks were successful
continuous-integration/drone/push Build is passing
build: use lefthook for pre-commit (#5248)
update docs
update nix-shell to auto install
rework custom pre-commit hooks to integrate better
add dockerfile for lefthook and integrate into drone
add some more hooks for formatting and linting some files

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5248
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
2025-08-27 15:22:06 +00:00

62 lines
2.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output doctype-system="about:legacy-compat" encoding="utf-8" indent="no" method="xml" omit-xml-declaration="yes"/>
<xsl:param name="link"/>
<xsl:template match="/html">
<xsl:text>
</xsl:text>
<xsl:comment> ***************************************************** </xsl:comment>
<xsl:comment> This file has been automatically generated. </xsl:comment>
<xsl:comment> Please do not modify it, and do not commit it to git. </xsl:comment>
<xsl:comment> ***************************************************** </xsl:comment>
<xsl:text>
</xsl:text>
<xsl:element name="newsset">
<xsl:element name="news">
<xsl:attribute name="date">
<xsl:value-of select="/html/@newsdate"/>
</xsl:attribute>
<xsl:if test="/html/@type">
<xsl:attribute name="type">
<xsl:value-of select="/html/@type"/>
</xsl:attribute>
</xsl:if>
<xsl:element name="title">
<xsl:value-of select="/html/head/title"/>
</xsl:element>
<xsl:element name="body">
<xsl:copy-of select="/html/body/p[1]"/>
</xsl:element>
<xsl:element name="body-complete">
<xsl:copy-of select="/html/body/node()"/>
</xsl:element>
<xsl:element name="image">
<xsl:attribute name="url">
<xsl:value-of select="/html/image/@url"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="/html/image/@alt"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="link">
<xsl:variable name="the_link">
<xsl:value-of select="/html/@link"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(string($the_link))">
<xsl:value-of select="$link"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$the_link"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:copy-of select="/html/tags"/>
<xsl:copy-of select="/html/author"/>
<xsl:copy-of select="/html/podcast"/>
<xsl:copy-of select="/html/discussion"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>