lib/isodoc/cc/cc.standard.xsl in metanorma-cc-1.8.4 vs lib/isodoc/cc/cc.standard.xsl in metanorma-cc-1.8.5

- old
+ new

@@ -417,11 +417,11 @@ </fo:block> </xsl:template> - <xsl:template match="csd:title"> + <xsl:template match="csd:title" name="title"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> @@ -580,11 +580,13 @@ <xsl:template match="csd:li"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> <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> @@ -3002,10 +3004,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"> @@ -5197,10 +5200,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"> @@ -5650,9 +5698,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