Skip to content

Commit

Permalink
Merge pull request #248 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 7, 2024
2 parents 9921048 + e94c85e commit c96e888
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 16 deletions.
34 changes: 26 additions & 8 deletions lib/isodoc/m3aawg/m3aawg.policy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4040,7 +4040,8 @@
</xsl:choose>
</xsl:variable>
<xsl:variable name="current_fn_number_text">
<xsl:value-of select="$current_fn_number"/>

<xsl:value-of select="$current_fn_number"/>

</xsl:variable>

Expand Down Expand Up @@ -5363,9 +5364,19 @@
</fo:inline>
</xsl:template>

<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
<xsl:param name="txt"/>
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
<xsl:variable name="text" select="."/>
<xsl:variable name="text">
<xsl:choose>
<xsl:when test="$txt != ''">
<xsl:value-of select="$txt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ratio_">
0.75
</xsl:variable>
Expand Down Expand Up @@ -9397,12 +9408,14 @@

<xsl:when test="contains(normalize-space($fo_element), 'list')">

<xsl:variable name="provisional_distance_between_starts">
<xsl:variable name="provisional_distance_between_starts_">
7
</xsl:variable>
<xsl:variable name="indent">
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
<xsl:variable name="indent_">
0
</xsl:variable>
<xsl:variable name="indent" select="normalize-space($indent_)"/>

<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
<fo:list-item>
Expand Down Expand Up @@ -10130,14 +10143,17 @@
</xsl:when>
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->

<xsl:variable name="label">
<xsl:variable name="type" select="../@type"/>

<xsl:variable name="type" select="../@type"/>
<xsl:variable name="label">

<xsl:variable name="style_prefix_">
<xsl:if test="$type = 'roman'">
<!-- Example: (i) -->
</xsl:if>
<xsl:if test="$type = 'alphabet'">

</xsl:if>
</xsl:variable>
<xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>

Expand All @@ -10163,13 +10179,15 @@
<xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
<xsl:value-of select="$style_prefix"/>
</xsl:if>

<xsl:value-of select="@label"/>

<xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
<xsl:value-of select="$style_suffix"/>
</xsl:if>
</xsl:variable>

<xsl:value-of select="normalize-space($label)"/>
<xsl:value-of select="normalize-space($label)"/>

</xsl:when>
<xsl:otherwise> <!-- for ordered lists 'ol' -->
Expand Down
34 changes: 26 additions & 8 deletions lib/isodoc/m3aawg/m3aawg.report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4040,7 +4040,8 @@
</xsl:choose>
</xsl:variable>
<xsl:variable name="current_fn_number_text">
<xsl:value-of select="$current_fn_number"/>

<xsl:value-of select="$current_fn_number"/>

</xsl:variable>

Expand Down Expand Up @@ -5363,9 +5364,19 @@
</fo:inline>
</xsl:template>

<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
<xsl:param name="txt"/>
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
<xsl:variable name="text" select="."/>
<xsl:variable name="text">
<xsl:choose>
<xsl:when test="$txt != ''">
<xsl:value-of select="$txt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ratio_">
0.75
</xsl:variable>
Expand Down Expand Up @@ -9397,12 +9408,14 @@

<xsl:when test="contains(normalize-space($fo_element), 'list')">

<xsl:variable name="provisional_distance_between_starts">
<xsl:variable name="provisional_distance_between_starts_">
7
</xsl:variable>
<xsl:variable name="indent">
<xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
<xsl:variable name="indent_">
0
</xsl:variable>
<xsl:variable name="indent" select="normalize-space($indent_)"/>

<fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
<fo:list-item>
Expand Down Expand Up @@ -10130,14 +10143,17 @@
</xsl:when>
<xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->

<xsl:variable name="label">
<xsl:variable name="type" select="../@type"/>

<xsl:variable name="type" select="../@type"/>
<xsl:variable name="label">

<xsl:variable name="style_prefix_">
<xsl:if test="$type = 'roman'">
<!-- Example: (i) -->
</xsl:if>
<xsl:if test="$type = 'alphabet'">

</xsl:if>
</xsl:variable>
<xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>

Expand All @@ -10163,13 +10179,15 @@
<xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
<xsl:value-of select="$style_prefix"/>
</xsl:if>

<xsl:value-of select="@label"/>

<xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
<xsl:value-of select="$style_suffix"/>
</xsl:if>
</xsl:variable>

<xsl:value-of select="normalize-space($label)"/>
<xsl:value-of select="normalize-space($label)"/>

</xsl:when>
<xsl:otherwise> <!-- for ordered lists 'ol' -->
Expand Down

0 comments on commit c96e888

Please sign in to comment.