lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.5.1 vs lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.5.2

- old
+ new

@@ -2321,18 +2321,40 @@ </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> + <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> + <xsl:if test="local-name(*[1]) != 'stem'"> + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> + </xsl:if> + </xsl:if> --> - <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> </fo:block> </fo:table-cell> </fo:table-row> - + <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> + <xsl:if test="local-name(*[1]) = 'stem'"> + <fo:table-row> + <fo:table-cell> + <fo:block margin-top="6pt"> + <xsl:if test="normalize-space($key_iso) = 'true'"> + <xsl:attribute name="margin-top">0</xsl:attribute> + </xsl:if> + <xsl:text>&#xA0;</xsl:text> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block> + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + </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/> </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> @@ -3098,26 +3120,34 @@ <fo:block xsl:use-attribute-sets="recommendation-label-style"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt"> + <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> + <xsl:attribute name="margin-bottom">0pt</xsl:attribute> + </xsl:if> <fo:block-container margin-left="0mm" margin-right="0mm"> - <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black"> + <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black"> + <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> + <xsl:attribute name="border">0.5pt solid black</xsl:attribute> + </xsl:if> <xsl:variable name="simple-table"> <xsl:call-template name="getSimpleTable"/> </xsl:variable> <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/> <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])"> - <fo:table-column column-width="35mm"/> - <fo:table-column column-width="115mm"/> + <!-- <fo:table-column column-width="35mm"/> + <fo:table-column column-width="115mm"/> --> + <fo:table-column column-width="25%"/> + <fo:table-column column-width="75%"/> </xsl:if> <xsl:apply-templates mode="requirement"/> </fo:table> <!-- fn processing --> <xsl:if test=".//*[local-name() = 'fn']"> <xsl:for-each select="*[local-name() = 'tbody']"> - <fo:block font-size="90%" border-bottom="1.pt solid black"> + <fo:block font-size="90%" border-bottom="1pt solid black"> <xsl:call-template name="fn_display"/> </fo:block> </xsl:for-each> </xsl:if> </fo:block-container> @@ -3129,21 +3159,24 @@ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement"> <fo:table-body> <xsl:apply-templates mode="requirement"/> </fo:table-body> </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement"> - <fo:table-row> + <fo:table-row height="7mm"> + <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])"> + <xsl:attribute name="border">1pt solid black</xsl:attribute> + </xsl:if> <xsl:apply-templates mode="requirement"/> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement"> - <fo:table-cell text-align="{@align}"> + <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black"> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@align"> <xsl:value-of select="@align"/> </xsl:when> - <xsl:otherwise>center</xsl:otherwise> + <xsl:otherwise>left</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> @@ -3153,25 +3186,29 @@ <xsl:attribute name="number-rows-spanned"> <xsl:value-of select="@rowspan"/> </xsl:attribute> </xsl:if> - <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> + <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> <xsl:attribute name="padding-top">0.5mm</xsl:attribute> <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute> </xsl:if> <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'"> <xsl:attribute name="padding-top">0.5mm</xsl:attribute> <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute> - </xsl:if> + </xsl:if> --> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement"> - <fo:table-cell text-align="{@align}"> + <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black"> + <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> + <xsl:attribute name="padding">0mm</xsl:attribute> + <xsl:attribute name="padding-left">0mm</xsl:attribute> + </xsl:if> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@align"> <xsl:value-of select="@align"/> </xsl:when> @@ -3187,28 +3224,29 @@ <xsl:attribute name="number-rows-spanned"> <xsl:value-of select="@rowspan"/> </xsl:attribute> </xsl:if> - <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> + <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> <xsl:attribute name="padding-left">0.5mm</xsl:attribute> - <xsl:attribute name="padding-top">0.5mm</xsl:attribute> - <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below --> + <xsl:attribute name="padding-top">0.5mm</xsl:attribute> + <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute> </xsl:if> - </xsl:if> + </xsl:if> --> + <!-- 2nd line and below --> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2"> - <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt"> + <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" --> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]"> - <fo:block margin-bottom="10pt"> + </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]"> + <fo:block> <!-- margin-bottom="10pt" --> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'termexample']"> <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style"> <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> @@ -3545,9 +3583,47 @@ </fo:table-row> </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*"> <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm"> <fo:block><xsl:apply-templates/></fo:block> </fo:table-cell> + </xsl:template><xsl:template name="processBibitem"> + + </xsl:template><xsl:template name="processPersonalAuthor"> + <xsl:choose> + <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']"> + <author> + <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/> + </author> + </xsl:when> + <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']"> + <author> + <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/> + </author> + </xsl:when> + <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']"> + <author> + <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/> + </author> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template name="renderDate"> + <xsl:if test="normalize-space(*[local-name() = 'on']) != ''"> + <xsl:value-of select="*[local-name() = 'on']"/> + </xsl:if> + <xsl:if test="normalize-space(*[local-name() = 'from']) != ''"> + <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip"> + <xsl:value-of select="translate(.,'. ','')"/> + </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip"> + <xsl:value-of select="substring(.,1,1)"/> </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