lib/isodoc/itu/itu.resolution.xsl in metanorma-itu-1.2.0 vs lib/isodoc/itu/itu.resolution.xsl in metanorma-itu-1.2.1

- old
+ new

@@ -313,11 +313,11 @@ <fo:block text-align="center" margin-top="15pt" margin-bottom="15pt"> <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/> </fo:block> </fo:block-container> <!-- Summary, History ... --> - <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()"/> + <xsl:call-template name="processPrefaceSectionsDefault"/> <!-- Keywords --> <xsl:if test="/itu:itu-standard/itu:bibdata/itu:keyword"> <fo:block font-size="12pt"> <xsl:value-of select="$linebreak"/> @@ -756,11 +756,11 @@ </fo:block> </fo:block> </xsl:template> <!-- Bibliography --> - <xsl:template match="itu:references[position() &gt; 1]/itu:title"> + <xsl:template match="itu:references[not(@normative='true')]/itu:title"> <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-bottom="18pt"> <xsl:apply-templates/> </fo:block> </xsl:template> @@ -1111,17 +1111,17 @@ </fo:instream-foreign-object> </fo:inline> </xsl:template> - <xsl:template match="itu:references[1]"> + <xsl:template match="itu:references[@normative='true']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="itu:references[position() &gt; 1]"> + <xsl:template match="itu:references[not(@normative='true')]"> <fo:block break-after="page"/> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> </xsl:template> @@ -1381,10 +1381,11 @@ </xsl:attribute-set><xsl:attribute-set name="example-body-style"> + </xsl:attribute-set><xsl:attribute-set name="example-name-style"> @@ -1397,12 +1398,14 @@ + + </xsl:attribute-set><xsl:attribute-set name="example-p-style"> @@ -1415,10 +1418,12 @@ + + </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> @@ -1436,10 +1441,11 @@ + </xsl:attribute-set><xsl:attribute-set name="appendix-style"> </xsl:attribute-set><xsl:attribute-set name="appendix-example-style"> @@ -1563,11 +1569,11 @@ - + </xsl:attribute-set><xsl:attribute-set name="formula-style"> <xsl:attribute name="margin-top">6pt</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> @@ -1611,11 +1617,47 @@ </xsl:attribute-set><xsl:attribute-set name="deprecates-style"> </xsl:attribute-set><xsl:attribute-set name="definition-style"> - </xsl:attribute-set><xsl:template match="text()"> + </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents"> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/> + </xsl:template><xsl:template name="processMainSectionsDefault_Contents"> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/> + + <!-- Normative references --> + <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/> + <!-- Terms and definitions --> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/> + <!-- Another main sections --> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/> + <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/> + <!-- Bibliography --> + <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/> + </xsl:template><xsl:template name="processPrefaceSectionsDefault"> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/> + <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/> + </xsl:template><xsl:template name="processMainSectionsDefault"> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/> + + <!-- Normative references --> + <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/> + <!-- Terms and definitions --> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/> + <!-- Another main sections --> + <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/> + <xsl:apply-templates select="/*/*[local-name()='annex']"/> + <!-- Bibliography --> + <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/> + </xsl:template><xsl:template match="text()"> <xsl:value-of select="."/> </xsl:template><xsl:template match="*[local-name()='br']"> <xsl:value-of select="$linebreak"/> </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1"> <!-- <xsl:call-template name="add-zero-spaces"/> --> @@ -1698,10 +1740,11 @@ <xsl:attribute name="space-after">18pt</xsl:attribute> + <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true"> <xsl:attribute name="margin-left">0mm</xsl:attribute> @@ -1715,10 +1758,11 @@ <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:for-each select="xalan:nodeset($colwidths)//column"> <xsl:choose> <xsl:when test=". = 1 or . = 0"> <fo:table-column column-width="proportional-column-width(2)"/> </xsl:when> @@ -1969,10 +2013,18 @@ <xsl:apply-templates/> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='th']"> <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center"> + <xsl:attribute name="text-align"> + <xsl:choose> + <xsl:when test="@align"> + <xsl:value-of select="@align"/> + </xsl:when> + <xsl:otherwise>center</xsl:otherwise> + </xsl:choose> + </xsl:attribute> <xsl:if test="ancestor::*[local-name()='preface']"> <xsl:attribute name="border">solid black 0pt</xsl:attribute> @@ -1981,10 +2033,11 @@ + <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -1997,10 +2050,18 @@ <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template><xsl:template match="*[local-name()='td']"> <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm"> + <xsl:attribute name="text-align"> + <xsl:choose> + <xsl:when test="@align"> + <xsl:value-of select="@align"/> + </xsl:when> + <xsl:otherwise>left</xsl:otherwise> + </xsl:choose> + </xsl:attribute> <xsl:if test="ancestor::*[local-name()='preface']"> <xsl:attribute name="border">solid black 0pt</xsl:attribute> </xsl:if> @@ -3238,10 +3299,121 @@ </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']"> <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"> + <fo:block-container margin-left="0mm" margin-right="0mm"> + <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black"> + <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"/> + </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"> + <xsl:call-template name="fn_display"/> + </fo:block> + </xsl:for-each> + </xsl:if> + </fo:block-container> + </fo:block-container> + </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement"> + <fo:table-header> + <xsl:apply-templates mode="requirement"/> + </fo:table-header> + </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> + <xsl:apply-templates mode="requirement"/> + </fo:table-row> + </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement"> + <fo:table-cell text-align="{@align}"> + <xsl:attribute name="text-align"> + <xsl:choose> + <xsl:when test="@align"> + <xsl:value-of select="@align"/> + </xsl:when> + <xsl:otherwise>center</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:if test="@colspan"> + <xsl:attribute name="number-columns-spanned"> + <xsl:value-of select="@colspan"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@rowspan"> + <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: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> + + <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}"> + <xsl:attribute name="text-align"> + <xsl:choose> + <xsl:when test="@align"> + <xsl:value-of select="@align"/> + </xsl:when> + <xsl:otherwise>left</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:if test="@colspan"> + <xsl:attribute name="number-columns-spanned"> + <xsl:value-of select="@colspan"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@rowspan"> + <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: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="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() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2"> + <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt"> + <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: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"/> <xsl:apply-templates/> </fo:block> @@ -3513,11 +3685,11 @@ </fo:block> </xsl:template><xsl:template match="*[local-name() = 'definitions']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']"> + </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'annex']"> @@ -3767,10 +3939,11 @@ - + + </xsl:variable> <xsl:if test="$documentNS != $XSLNS"> <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message> </xsl:if> </xsl:template><xsl:template name="getLanguage"> \ No newline at end of file