lib/isodoc/m3aawg/m3aawg.policy.xsl in metanorma-m3aawg-2.1.3 vs lib/isodoc/m3aawg/m3aawg.policy.xsl in metanorma-m3aawg-2.1.4

- old
+ new

@@ -976,12 +976,15 @@ </xsl:attribute-set><xsl:attribute-set name="permission-label-style"> </xsl:attribute-set><xsl:attribute-set name="requirement-style"> + </xsl:attribute-set><xsl:attribute-set name="requirement-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="requirement-label-style"> </xsl:attribute-set><xsl:attribute-set name="subject-style"> </xsl:attribute-set><xsl:attribute-set name="inherit-style"> </xsl:attribute-set><xsl:attribute-set name="description-style"> @@ -1079,10 +1082,11 @@ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> + <xsl:attribute name="padding-right">1mm</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:attribute-set><xsl:variable name="table-border_"> @@ -1414,15 +1418,16 @@ </xsl:attribute-set><xsl:attribute-set name="note-p-style"> - + + <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-top">4pt</xsl:attribute> @@ -1430,10 +1435,11 @@ </xsl:attribute-set><xsl:attribute-set name="termnote-style"> + @@ -1861,18 +1867,21 @@ <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <!-- <xsl:if test="$namespace = 'ieee'"> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute> + </xsl:if> --> - </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style"> @@ -3059,87 +3068,95 @@ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - <fo:table keep-with-previous="always"> - <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> - <xsl:variable name="name" select="local-name()"/> + + <xsl:variable name="tableWithNotesAndFootnotes"> + + <fo:table keep-with-previous="always"> + <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> + <xsl:variable name="name" select="local-name()"/> + <xsl:choose> + <xsl:when test="$name = 'border-top'"> + <xsl:attribute name="{$name}">0pt solid black</xsl:attribute> + </xsl:when> + <xsl:when test="$name = 'border'"> + <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> + <xsl:attribute name="border-top">0pt solid black</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + + + <xsl:choose> - <xsl:when test="$name = 'border-top'"> - <xsl:attribute name="{$name}">0pt solid black</xsl:attribute> + <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> + <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']"> + <fo:table-column column-width="{@width}"/> + </xsl:for-each> </xsl:when> - <xsl:when test="$name = 'border'"> - <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> - <xsl:attribute name="border-top">0pt solid black</xsl:attribute> - </xsl:when> <xsl:otherwise> - <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> + <!-- $colwidths=<xsl:copy-of select="$colwidths"/> --> + <xsl:call-template name="insertTableColumnWidth"> + <xsl:with-param name="colwidths" select="$colwidths"/> + </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:for-each> - - - - <xsl:choose> - <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> - <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']"> - <fo:table-column column-width="{@width}"/> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> - <!-- $colwidths=<xsl:copy-of select="$colwidths"/> --> - <xsl:call-template name="insertTableColumnWidth"> - <xsl:with-param name="colwidths" select="$colwidths"/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - - <fo:table-body> - <fo:table-row> - <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}"> - - + + <fo:table-body> + <fo:table-row> + <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}"> + + - - - <!-- fn will be processed inside 'note' processing --> - - - - - - - <!-- for BSI (not PAS) display Notes before footnotes --> - - - <!-- except gb and bsi --> - - <xsl:apply-templates select="../*[local-name()='note']"/> - - - <!-- horizontal row separator --> - - - <!-- fn processing --> - - <xsl:call-template name="table_fn_display"/> - - - <!-- for PAS display Notes after footnotes --> - - - </fo:table-cell> - </fo:table-row> - </fo:table-body> - - </fo:table> + <!-- fn will be processed inside 'note' processing --> + + + + + + + <!-- for BSI (not PAS) display Notes before footnotes --> + + + <!-- except gb and bsi --> + + <xsl:apply-templates select="../*[local-name()='note']"/> + + + + <!-- horizontal row separator --> + + + <!-- fn processing --> + + <xsl:call-template name="table_fn_display"/> + + + + <!-- for PAS display Notes after footnotes --> + + + </fo:table-cell> + </fo:table-row> + </fo:table-body> + + </fo:table> + </xsl:variable> + <xsl:if test="normalize-space($tableWithNotesAndFootnotes) != ''"> + <xsl:copy-of select="$tableWithNotesAndFootnotes"/> + </xsl:if> + </xsl:if> </xsl:template><xsl:template match="*[local-name()='tbody']"> <xsl:variable name="cols-count"> <xsl:choose> @@ -3426,10 +3443,11 @@ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/> <xsl:variable name="footnote_inline"> <fo:inline xsl:use-attribute-sets="fn-num-style"> + <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <xsl:value-of select="$current_fn_number_text"/> </fo:basic-link> </fo:inline> </xsl:variable> @@ -3447,12 +3465,16 @@ <fo:block-container xsl:use-attribute-sets="fn-container-body-style"> <fo:block xsl:use-attribute-sets="fn-body-style"> + <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style"> + + + <xsl:value-of select="$current_fn_number_text"/> </fo:inline> <xsl:apply-templates/> </fo:block> </fo:block-container> @@ -5138,10 +5160,12 @@ + + <xsl:choose> <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> @@ -5345,10 +5369,11 @@ </xsl:if> + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> --> <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> @@ -5366,10 +5391,11 @@ <xsl:when test="$sfx != ''"> <xsl:value-of select="$sfx"/> </xsl:when> <xsl:otherwise> + <xsl:text>:</xsl:text> </xsl:otherwise> </xsl:choose> @@ -5386,10 +5412,11 @@ <xsl:value-of select="$sfx"/> </xsl:when> <xsl:otherwise> + </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="normalize-space() != ''"> <xsl:apply-templates/> @@ -6165,10 +6192,13 @@ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="figure-name-style"> + + + <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> @@ -6225,11 +6255,11 @@ </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref']" mode="contents"> + </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref'] | *[local-name() = 'eref']" mode="contents"> <xsl:value-of select="."/> </xsl:template><xsl:template match="*[local-name() = 'review']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item"> <xsl:text> </xsl:text> </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item"> <xsl:copy> @@ -6301,10 +6331,13 @@ <!-- 9 --> + <!-- <xsl:if test="$namespace = 'ieee'"> + <xsl:if test="$doctype = 'standard' and $stage = 'published'">8</xsl:if> + </xsl:if> --> @@ -6745,14 +6778,18 @@ </fo:inline> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> <xsl:variable name="element">inline + </xsl:variable> <xsl:choose> <xsl:when test="contains($element, 'block')"> <fo:block xsl:use-attribute-sets="example-p-style"> + + + <xsl:apply-templates/> </fo:block> </xsl:when> <xsl:otherwise> <fo:inline><xsl:apply-templates/></fo:inline> @@ -6856,10 +6893,11 @@ <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:if> <fo:block xsl:use-attribute-sets="example-p-style"> + <xsl:apply-templates/> </fo:block> </fo:block-container> </xsl:when> <xsl:otherwise> @@ -7014,10 +7052,12 @@ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets --> <xsl:variable name="text" select="normalize-space()"/> + + <fo:basic-link fox:alt-text="{@citeas}"> <xsl:if test="normalize-space(@citeas) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute> </xsl:if> <xsl:if test="@type = 'inline'"> @@ -7439,10 +7479,12 @@ <fo:list-item-label end-indent="label-end()"> <fo:block xsl:use-attribute-sets="list-item-label-style"> + + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> @@ -7703,11 +7745,11 @@ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style"> <xsl:call-template name="processBibitem"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2"> + </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2"> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' --> <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages --> <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style"> @@ -7716,13 +7758,11 @@ <fo:block> <fo:inline> <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/> <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])"> - - <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/> - + <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/> </xsl:if> </fo:inline> </fo:block> </fo:list-item-label> @@ -8473,10 +8513,10 @@ </xsl:for-each> </dc:creator> <dc:description> <xsl:variable name="abstract"> - <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/> + <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/> </xsl:variable> <xsl:value-of select="normalize-space($abstract)"/> </dc:description> <pdf:Keywords> \ No newline at end of file