Skip to content

Commit

Permalink
OGC xslt updated for metanorma/metanorma-ogc#598
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Nov 1, 2023
1 parent 55a50b9 commit cb7ba22
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions xslt_src/ogc.standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
<xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
Expand All @@ -1177,17 +1177,17 @@
</fo:block>
</xsl:template>

<xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
<xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>

<!-- first preferred displays on the same line as term/name -->
<xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
<fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates /></fo:inline>
<fo:inline padding-right="2mm">&#xA0;</fo:inline>
</xsl:template>

<xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
<xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
<xsl:choose>
<xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
<xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
<fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
</xsl:when>
<xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
Expand All @@ -1209,7 +1209,7 @@
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
</xsl:call-template>
</fo:inline> -->
<xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
<xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
<fo:inline padding-right="2mm">&#xA0;</fo:inline>
</xsl:if>
</xsl:template>
Expand All @@ -1224,15 +1224,16 @@
<fo:inline>&#xa0;</fo:inline>
<fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
<xsl:variable name="kind" select="@class"/>
<xsl:variable name="label" select="text()"/>
<xsl:attribute name="background-color">
<xsl:choose>
<xsl:when test="$kind = 'PreferredLabel'">rgb(249, 235, 187)</xsl:when>
<xsl:when test="$kind = 'DeprecatedLabel'">rgb(237, 237, 238)</xsl:when>
<xsl:when test="$kind = 'AdmittedLabel'">rgb(223, 236, 249)</xsl:when>
<xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
<xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
<xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:call-template name="addLetterSpacing">
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(text()))"/>
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
</xsl:call-template>
</fo:inline>
</xsl:template>
Expand Down

0 comments on commit cb7ba22

Please sign in to comment.