Skip to content

Commit

Permalink
[#223] FIx xsl formatting for style checker
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Jan 18, 2024
1 parent 13d2842 commit 0f9fc5b
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions assets/puzzles_json.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">{</xsl:text>
<xsl:apply-templates select="puzzles"/>
<xsl:template match="/"><xsl:text disable-output-escaping="yes">{</xsl:text><xsl:apply-templates select="puzzles"/>
"puzzles": [
<xsl:apply-templates select="puzzles/puzzle"/>
<xsl:text disable-output-escaping="yes">
Expand All @@ -35,28 +33,47 @@ SOFTWARE.
</xsl:template>
<xsl:template match="puzzles">
<xsl:text>
"version": "</xsl:text><xsl:value-of select="@version"/><xsl:text>",</xsl:text>
"version": "</xsl:text>
<xsl:value-of select="@version"/>
<xsl:text>",</xsl:text>
<xsl:text>
"date": "</xsl:text><xsl:value-of select="@date"/><xsl:text>", </xsl:text>
"date": "</xsl:text>
<xsl:value-of select="@date"/>
<xsl:text>", </xsl:text>
</xsl:template>
<xsl:template match="puzzle">
<xsl:text disable-output-escaping="no"> {</xsl:text>
<xsl:text disable-output-escaping="no">{</xsl:text>
<xsl:text>
"id": "</xsl:text><xsl:value-of select="id"/><xsl:text>", </xsl:text>
"id": "</xsl:text>
<xsl:value-of select="id"/>
<xsl:text>", </xsl:text>
<xsl:text>
"ticket": "</xsl:text><xsl:value-of select="ticket"/><xsl:text>", </xsl:text>
"ticket": "</xsl:text>
<xsl:value-of select="ticket"/>
<xsl:text>", </xsl:text>
<xsl:text>
"file": "</xsl:text><xsl:value-of select="file"/><xsl:text>", </xsl:text>
"file": "</xsl:text>
<xsl:value-of select="file"/>
<xsl:text>", </xsl:text>
<xsl:text>
"lines": "</xsl:text><xsl:value-of select="lines"/><xsl:text>", </xsl:text>
"lines": "</xsl:text>
<xsl:value-of select="lines"/>
<xsl:text>", </xsl:text>
<xsl:text>
"body": "</xsl:text><xsl:value-of select="translate(body, '&quot;', '“')"/><xsl:text>", </xsl:text>
"body": "</xsl:text>
<xsl:value-of select="translate(body, '&quot;', '&#x201C;')"/>
<xsl:text>", </xsl:text>
<xsl:text>
"estimate": "</xsl:text><xsl:value-of select="estimate"/><xsl:text>", </xsl:text>
"estimate": "</xsl:text>
<xsl:value-of select="estimate"/>
<xsl:text>", </xsl:text>
<xsl:text>
"role": "</xsl:text><xsl:value-of select="role"/><xsl:text>"</xsl:text>
"role": "</xsl:text>
<xsl:value-of select="role"/>
<xsl:text>"</xsl:text>
<xsl:text disable-output-escaping="yes">
}</xsl:text><xsl:if test="position() != last()">,
}</xsl:text>
<xsl:if test="position() != last()">,
</xsl:if>
</xsl:template>
</xsl:stylesheet>

0 comments on commit 0f9fc5b

Please sign in to comment.