lib/isodoc/iho/iho.specification.xsl in metanorma-iho-0.4.4 vs lib/isodoc/iho/iho.specification.xsl in metanorma-iho-0.4.5

- old
+ new

@@ -464,11 +464,11 @@ <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always" role="H1"> <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="iho:title"> + <xsl:template match="iho:title" name="title"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> @@ -818,11 +818,13 @@ </xsl:template> <xsl:template name="getListItemFormat"> <xsl:choose> - <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash --> + <xsl:when test="local-name(..) = 'ul'"> + <xsl:call-template name="setULLabel"/> + </xsl:when> <xsl:otherwise> <!-- for ordered lists --> <xsl:choose> <xsl:when test="../@type = 'arabic'"> <xsl:number format="a)" lang="en"/> </xsl:when> @@ -3146,10 +3148,11 @@ </xsl:if> </xsl:if> --> </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process"> <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process"> + <xsl:apply-templates select="@language"/> <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline> </xsl:template><xsl:template match="*[local-name()='em']"> <fo:inline font-style="italic"> @@ -5340,10 +5343,55 @@ <!-- <fo:block font-weight="bold">Review:</fo:block> <xsl:apply-templates /> --> </xsl:template><xsl:template match="*[local-name() = 'name']/text()"> <!-- 0xA0 to space replacement --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/> + </xsl:template><xsl:variable name="ul_labels_"> + + + + + + + <label>—</label> <!-- em dash --> + + + + + + + + + + + + + </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel"> + <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/> + <xsl:variable name="list_level"> + <xsl:choose> + <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when> + <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels --> + <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/> + </xsl:when> + <xsl:when test="$list_level mod 3 = 0"> + <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/> + </xsl:when> + <xsl:when test="$list_level mod 2 = 0"> + <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template match="label" mode="ul_labels"> + <xsl:copy-of select="@*[not(local-name() = 'level')]"/> + <xsl:value-of select="."/> </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']"> <xsl:choose> <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']"> <fo:block-container> <xsl:attribute name="margin-left"> @@ -5892,9 +5940,13 @@ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2"> <rect x="0" y="0" width="2" height="2" fill="black"/> </svg> </fo:instream-foreign-object> </fo:inline> + </xsl:template><xsl:template match="@language"> + <xsl:copy-of select="."/> + </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4"> + <xsl:call-template name="title"/> </xsl:template><xsl:template name="convertDate"> <xsl:param name="date"/> <xsl:param name="format" select="'short'"/> <xsl:variable name="year" select="substring($date, 1, 4)"/> <xsl:variable name="month" select="substring($date, 6, 2)"/> \ No newline at end of file