Skip to content

Commit

Permalink
Merge pull request #184 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 7, 2023
2 parents 746deb4 + 28bf150 commit 9863b9c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions lib/isodoc/m3aawg/m3aawg.policy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4883,8 +4883,17 @@
<xsl:variable name="styles_">
<xsl:for-each select="xalan:nodeset($styles__)/item">
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
<xsl:if test="$key = 'font-family' or $key = 'color'">
<xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
<xsl:variable name="value">
<xsl:choose>
<!-- if font-size is digits only -->
<xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value_"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
<style name="{$key}"><xsl:value-of select="$value"/></style>
</xsl:if>
</xsl:for-each>
Expand Down
13 changes: 11 additions & 2 deletions lib/isodoc/m3aawg/m3aawg.report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4883,8 +4883,17 @@
<xsl:variable name="styles_">
<xsl:for-each select="xalan:nodeset($styles__)/item">
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
<xsl:if test="$key = 'font-family' or $key = 'color'">
<xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
<xsl:variable name="value">
<xsl:choose>
<!-- if font-size is digits only -->
<xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value_"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
<style name="{$key}"><xsl:value-of select="$value"/></style>
</xsl:if>
</xsl:for-each>
Expand Down

0 comments on commit 9863b9c

Please sign in to comment.