lib/isodoc/ogc/ogc.white-paper.xsl in metanorma-ogc-2.1.1 vs lib/isodoc/ogc/ogc.white-paper.xsl in metanorma-ogc-2.1.2

- old
+ new

@@ -250,11 +250,11 @@ </fo:block> </fo:block-container> <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> - <xsl:for-each select="/*/*[local-name()='preface']/*"> + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:if test="local-name() = 'abstract' or local-name() = 'foreword' or local-name() = 'introduction'"> <fo:block break-after="page"/> </xsl:if> @@ -641,18 +641,45 @@ </fo:block-container> </xsl:otherwise> </xsl:choose> </xsl:template> -<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_"> +<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_"> + <xsl:for-each select="$table_widths_from_if//table"> + <xsl:copy> + <xsl:copy-of select="@*"/> + <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/> + </xsl:copy> + </xsl:for-each> + </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_"> false </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang"> <xsl:call-template name="getLang"/> - </xsl:variable><xsl:variable name="pageWidth_"> - 215.9 + </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_"> + <xsl:choose> + <xsl:when test="$papersize = 'letter'">215.9</xsl:when> + <xsl:when test="$papersize = 'a4'">210</xsl:when> + </xsl:choose> + </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_"> + <xsl:choose> + <xsl:when test="$papersize = 'letter'">279.4</xsl:when> + <xsl:when test="$papersize = 'a4'">297</xsl:when> + </xsl:choose> + </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_"> + <xsl:choose> + <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when> + <xsl:otherwise> + 215.9 + </xsl:otherwise> + </xsl:choose> </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_"> - 279.4 + <xsl:choose> + <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when> + <xsl:otherwise> + 279.4 + </xsl:otherwise> + </xsl:choose> </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_"> 25.4 </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_"> 25.4 </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_"> @@ -1300,10 +1327,30 @@ <xsl:attribute name="margin-top">0pt</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="dl-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + + + + + + + + + + <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute> + <xsl:attribute name="font-weight">normal</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="dd-cell-style"> <xsl:attribute name="padding-left">2mm</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="appendix-style"> <xsl:attribute name="font-size">12pt</xsl:attribute> @@ -1640,10 +1687,29 @@ <xsl:attribute name="line-height">115%</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="list-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + + + + + + + + + <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute> + <xsl:attribute name="font-weight">normal</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="list-item-style"> </xsl:attribute-set><xsl:attribute-set name="list-item-label-style"> @@ -2053,17 +2119,17 @@ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents"> <xsl:variable name="nodes_preface_"> - <xsl:for-each select="/*/*[local-name()='preface']/*"> + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <node id="{@id}"/> </xsl:for-each> </xsl:variable> <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/> - <xsl:for-each select="/*/*[local-name()='preface']/*"> + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <xsl:sort select="@displayorder" data-type="number"/> <!-- process Section's title --> <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/> <xsl:if test="$preceding-sibling_id != ''"> @@ -2125,11 +2191,11 @@ <xsl:copy-of select="*[local-name() = 'name']"/> </figure> </xsl:for-each> </figures> </xsl:template><xsl:template name="processPrefaceSectionsDefault"> - <xsl:for-each select="/*/*[local-name()='preface']/*"> + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:template><xsl:template name="processMainSectionsDefault"> <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"> @@ -2775,50 +2841,39 @@ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each> </xsl:variable> <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces --> </xsl:if> </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm"> - <xsl:param name="table"/> - <xsl:param name="if">false</xsl:param> <!-- via intermediate format --> + <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step --> + + <!-- via intermediate format --> <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table --> <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. --> <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. --> <!-- get current table id --> <xsl:variable name="table_id" select="@id"/> <!-- find table by id in the file 'table_widths' --> - <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/> - <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> + <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/> + <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> --> - <!-- table='<xsl:copy-of select="$table"/>' --> <!-- table_id='<xsl:value-of select="$table_id"/>\ --> <!-- table-if='<xsl:copy-of select="$table-if"/>' --> <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' --> <xsl:variable name="table_with_cell_widths_"> - <xsl:choose> - <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF --> - - <!-- Example: <column>10</column> - <column>11</column> - --> - <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/> - </xsl:otherwise> - </xsl:choose> + <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF --> </xsl:variable> <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/> - <xsl:if test="$table_if_debug = 'true'"> + <!-- <xsl:if test="$table_if_debug = 'true'"> <xsl:copy-of select="$table_with_cell_widths"/> - </xsl:if> + </xsl:if> --> <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. --> <xsl:variable name="column_widths_"> @@ -2860,37 +2915,38 @@ </xsl:variable> <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/> <xsl:variable name="page_width"> <xsl:choose> - <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when> - <xsl:otherwise>75</xsl:otherwise> + <xsl:when test="$parent_table_page-width != ''"> + <xsl:value-of select="$parent_table_page-width"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@page-width"/> + </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="$table_if_debug = 'true'"> <table_width> <xsl:copy-of select="$table_widths"/> </table_width> - <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug> - <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug> - --> <debug>$page_width=<xsl:value-of select="$page_width"/></debug> </xsl:if> <!-- There are three cases: --> <xsl:choose> <!-- 1. The minimum table width is equal to or wider than the available space --> <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below --> <!-- call old algorithm --> <case1/> - <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/> + <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/> <xsl:call-template name="calculate-column-widths-proportional"> <xsl:with-param name="cols-count" select="$cols-count"/> <xsl:with-param name="table" select="$table"/> - </xsl:call-template> + </xsl:call-template> --> </xsl:when> <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. --> <xsl:when test="$table_widths/table/@width_max &lt;= $page_width"> <case2/> <autolayout/> @@ -2930,99 +2986,53 @@ </xsl:when> <xsl:otherwise><unknown_case/></xsl:otherwise> </xsl:choose> + </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm"> - </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths"> - <xsl:copy> - <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/> - </xsl:copy> - </xsl:template><xsl:template match="td | th" mode="determine_cell_widths"> - <xsl:copy> - <xsl:copy-of select="@*"/> + <!-- if nested 'dl' or 'table' --> + <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/> + <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id> - <!-- The maximum width is given by the widest line. --> - <xsl:variable name="widths_max"> - <xsl:for-each select=".//*[local-name() = 'p']"> - <xsl:call-template name="add_width"/> - </xsl:for-each> - <xsl:if test="not(*[local-name() = 'p'])"> - <xsl:call-template name="add_width"/> - </xsl:if> - </xsl:variable> - <xsl:variable name="width_max"> - <xsl:for-each select="xalan:nodeset($widths_max)//width"> - <xsl:sort select="." data-type="number" order="descending"/> - <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if> - </xsl:for-each> - </xsl:variable> - <xsl:attribute name="width_max"> - <xsl:value-of select="$width_max"/> - </xsl:attribute> + <parent_element><xsl:value-of select="local-name(..)"/></parent_element> - <!-- The minimum width is given by the widest text element (word, image, etc.) --> - <!-- To do: image width --> - <xsl:variable name="td_text"> - <xsl:apply-templates select="." mode="td_text"/> - </xsl:variable> - <xsl:variable name="words"> - <xsl:variable name="string_with_added_zerospaces"> - <xsl:call-template name="add-zero-spaces-java"> - <xsl:with-param name="text" select="$td_text"/> - </xsl:call-template> + <xsl:variable name="parent_table_page-width_"> + <xsl:if test="$parent_table_id != ''"> + <!-- determine column number in the parent table --> + <xsl:variable name="parent_table_column_number"> + <xsl:choose> + <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> + <xsl:otherwise> <!-- parent is table --> + <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/> + </xsl:otherwise> + </xsl:choose> </xsl:variable> - <xsl:call-template name="tokenize"> - <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space --> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="max_word_length"> - <xsl:call-template name="max_length"> - <xsl:with-param name="words" select="xalan:nodeset($words)"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="width_min"> - <xsl:value-of select="$max_word_length"/> - </xsl:variable> - <xsl:attribute name="width_min"> - <xsl:value-of select="$width_min"/> - </xsl:attribute> - <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals --> - <xsl:if test="$width_min &gt; $width_max"> - <xsl:attribute name="width_max"> - <xsl:value-of select="$width_min"/> - </xsl:attribute> + <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> --> + <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/> </xsl:if> - <xsl:if test="$width_min = 0"> - <xsl:attribute name="width_min">1</xsl:attribute> - </xsl:if> - - <xsl:apply-templates select="node()" mode="determine_cell_widths"/> - - </xsl:copy> - </xsl:template><xsl:template name="add_width"> - <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable> - <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/> - - <xsl:variable name="p_text_len"> - <xsl:choose> - <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters --> - <xsl:value-of select="$p_text_len_ * 1.5"/> - </xsl:when> - <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise> - </xsl:choose> </xsl:variable> + <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/> - <xsl:variable name="math_addon_text"> - <xsl:for-each select=".//*[local-name() = 'math']"> - <xsl:apply-templates mode="td_text"/> - </xsl:for-each> - </xsl:variable> - <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% --> + <!-- get current table id --> + <xsl:variable name="table_id" select="@id"/> - <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width> + <xsl:choose> + <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''"> + <!-- find table by id in the file 'table_widths' and get all `<column>...</column> --> + <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/> + </xsl:when> + <xsl:otherwise> + <!-- recalculate columns width based on parent table width --> + <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]"> + <xsl:call-template name="calculate-column-widths-autolayout-algorithm"> + <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000--> + </xsl:call-template> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/> </xsl:copy> </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if"> @@ -3807,15 +3817,23 @@ <fo:block> + + <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']"> + <xsl:attribute name="margin-top">0</xsl:attribute> + </xsl:if> + <fo:block> + <xsl:apply-templates select="*[local-name() = 'name']"> + <xsl:with-param name="process">true</xsl:with-param> + </xsl:apply-templates> <xsl:if test="$isGenerateTableIF = 'true'"> <!-- to determine start of table --> <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block> </xsl:if> @@ -3834,10 +3852,11 @@ </xsl:when> </xsl:choose> + <xsl:choose> <xsl:when test="$isGenerateTableIF = 'true'"> <!-- generate IF for table widths --> <!-- example: <tr> @@ -3962,18 +3981,35 @@ </fo:block> </fo:block> </xsl:if> <!-- END: a few components --> </fo:block-container> </fo:block-container> + + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' --> + <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/> + </xsl:if> + + </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']"> + <xsl:param name="process">false</xsl:param> + <xsl:if test="$process = 'true'"> + <fo:block xsl:use-attribute-sets="dl-name-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> </xsl:template><xsl:template name="setColumnWidth_dl"> <xsl:param name="colwidths"/> <xsl:param name="maxlength_dt"/> <xsl:param name="isContainsKeepTogetherTag"/> <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> --> <xsl:choose> + <xsl:when test="xalan:nodeset($colwidths)/autolayout"> + <xsl:call-template name="insertTableColumnWidth"> + <xsl:with-param name="colwidths" select="$colwidths"/> + </xsl:call-template> + </xsl:when> <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table --> <fo:table-column column-width="50%"/> <fo:table-column column-width="50%"/> </xsl:when> <xsl:otherwise> @@ -4222,16 +4258,28 @@ <td> <xsl:copy-of select="node()"/> </td> <td> - <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/> + <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> + + <!-- get paragraphs from nested 'dl' --> + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/> + </td> </tr> - </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']"> + </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested"> + <xsl:for-each select="*[local-name() = 'dt']"> + <p> + <xsl:copy-of select="node()"/> + <xsl:text> </xsl:text> + <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/> + </p> + </xsl:for-each> + </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> <xsl:param name="split_keep-within-line"/> @@ -4258,18 +4306,18 @@ + <!-- 10 --> - 9.5 </xsl:variable> <xsl:variable name="font-size" select="normalize-space($_font-size)"/> @@ -6273,14 +6321,14 @@ + <!-- 9 --> - 9.5 @@ -6357,11 +6405,11 @@ </xsl:variable> <xsl:for-each select="xalan:nodeset($text_step4)/node()"> <xsl:choose> <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space --> - <xsl:call-template name="interspers"> + <xsl:call-template name="interspers-java"> <xsl:with-param name="str" select="."/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> @@ -6407,10 +6455,14 @@ <xsl:call-template name="interspers"> <xsl:with-param name="str" select="substring($str, 2)"/> <xsl:with-param name="char" select="$char"/> </xsl:call-template> </xsl:if> + </xsl:template><xsl:template name="interspers-java"> + <xsl:param name="str"/> + <xsl:param name="char" select="$zero_width_space"/> + <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. --> </xsl:template><xsl:template match="*" mode="syntax_highlight"> <xsl:apply-templates mode="syntax_highlight"/> </xsl:template><xsl:variable name="syntax_highlight_styles_"> <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/> <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/> @@ -7377,26 +7429,42 @@ <xsl:apply-templates select="." mode="list"/> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list"> + + <xsl:apply-templates select="*[local-name() = 'name']"> + <xsl:with-param name="process">true</xsl:with-param> + </xsl:apply-templates> + <fo:list-block xsl:use-attribute-sets="list-style"> + <xsl:if test="*[local-name() = 'name']"> + <xsl:attribute name="margin-top">0pt</xsl:attribute> + </xsl:if> + <xsl:apply-templates select="node()[not(local-name() = 'note')]"/> </fo:list-block> <!-- <xsl:for-each select="./iho:note"> <xsl:call-template name="note"/> </xsl:for-each> --> <xsl:apply-templates select="./*[local-name() = 'note']"/> + </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']"> + <xsl:param name="process">false</xsl:param> + <xsl:if test="$process = 'true'"> + <fo:block xsl:use-attribute-sets="list-name-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> </xsl:template><xsl:template match="*[local-name()='li']"> <fo:list-item xsl:use-attribute-sets="list-item-style"> <xsl:copy-of select="@id"/> @@ -7696,147 +7764,11 @@ <!-- start OGC bibitem processing --> <xsl:if test=".//ogc:fn"> <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute> </xsl:if> - <xsl:choose> - <xsl:when test="*[local-name() = 'formattedref']"> - <xsl:apply-templates select="*[local-name() = 'formattedref']"/> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="personalAuthors"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']"> - <xsl:call-template name="processPersonalAuthor"/> - </xsl:for-each> - <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']"> - <xsl:call-template name="processPersonalAuthor"/> - </xsl:for-each> - </xsl:if> - </xsl:variable> - - <xsl:variable name="city" select="*[local-name() = 'place']"/> - <xsl:variable name="year"> - <xsl:choose> - <xsl:when test="*[local-name() = 'date'][@type = 'published']"> - <xsl:for-each select="*[local-name() = 'date'][@type = 'published']"> - <xsl:call-template name="renderDate"/> - </xsl:for-each> - </xsl:when> - <xsl:when test="*[local-name() = 'date'][@type = 'issued']"> - <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']"> - <xsl:call-template name="renderDate"/> - </xsl:for-each> - </xsl:when> - <xsl:when test="*[local-name() = 'date'][@type = 'circulated']"> - <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']"> - <xsl:call-template name="renderDate"/> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="*[local-name() = 'date']"> - <xsl:call-template name="renderDate"/> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:variable name="uri" select="*[local-name() = 'uri']"/> - - - <!-- citation structure: - {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year}) - --> - - <!-- Author(s) --> - <xsl:choose> - <xsl:when test="xalan:nodeset($personalAuthors)//author"> - <xsl:for-each select="xalan:nodeset($personalAuthors)//author"> - <xsl:apply-templates/> - <xsl:if test="position() != last()">, </xsl:if> - </xsl:for-each> - <xsl:text>: </xsl:text> - </xsl:when> - <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']"> - <xsl:value-of select="."/> - <xsl:if test="position() != last()">/</xsl:if> - </xsl:for-each> - <xsl:text>: </xsl:text> - </xsl:when> - <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']"> - <xsl:value-of select="."/> - <xsl:if test="position() != last()">, </xsl:if> - </xsl:for-each> - <xsl:text>: </xsl:text> - </xsl:when> - </xsl:choose> - - - <xsl:variable name="document_identifier"> - <xsl:call-template name="processBibitemDocId"/> - </xsl:variable> - - <xsl:value-of select="$document_identifier"/> - - <xsl:apply-templates select="*[local-name() = 'note']"/> - - <xsl:variable name="isDraft"> - <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/> - <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if> - </xsl:variable> - - <xsl:if test="$isDraft = 'true'"> - <xsl:text> (Draft)</xsl:text> - </xsl:if> - - <xsl:text>, </xsl:text> - - <xsl:choose> - <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']"> - <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates select="*[local-name() = 'title']"/> - </xsl:otherwise> - </xsl:choose> - - <xsl:text>. </xsl:text> - - <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']"> - <xsl:value-of select="."/> - <xsl:if test="position() != last()">, </xsl:if> - </xsl:for-each> - <xsl:if test="normalize-space($city) != ''">, </xsl:if> - </xsl:if> - - <xsl:value-of select="$city"/> - - <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''"> - <xsl:text> </xsl:text> - </xsl:if> - - <xsl:if test="normalize-space($year) != ''"> - <xsl:text>(</xsl:text> - <xsl:value-of select="$year"/> - <xsl:text>). </xsl:text> - </xsl:if> - - <xsl:if test="normalize-space($uri) != ''"> - <fo:inline> - - <xsl:text> </xsl:text> - <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}"> - <xsl:value-of select="$uri"/> - </fo:basic-link> - </fo:inline> - </xsl:if> - - </xsl:otherwise> - </xsl:choose> + <xsl:apply-templates select="*[local-name() = 'formattedref']"/> <!-- end OGC bibitem processing--> </xsl:template><xsl:template name="processBibitemDocId"> <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/> <xsl:choose> @@ -8160,28 +8092,35 @@ </fo:block-container> </fo:block-container> </xsl:template><xsl:template name="displayAdmonitionName"> - + <xsl:param name="sep"/> <!-- Example: ' - ' --> + <!-- <xsl:choose> + <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> + <xsl:choose> + <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="*[local-name() = 'name']"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> <xsl:apply-templates select="*[local-name() = 'name']"/> <xsl:if test="not(*[local-name() = 'name'])"> <xsl:apply-templates select="@type"/> </xsl:if> - - </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']"> - <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type"> - <xsl:variable name="admonition_type_"> - <xsl:call-template name="getLocalizedString"> - <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param> - </xsl:call-template> + </xsl:otherwise> + </xsl:choose> --> + <xsl:variable name="name"> + <xsl:apply-templates select="*[local-name() = 'name']"/> </xsl:variable> - <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/> - <xsl:value-of select="$admonition_type"/> - <xsl:if test="$admonition_type = ''"> - <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/> + <xsl:copy-of select="$name"/> + <xsl:if test="normalize-space($name) != ''"> + <xsl:value-of select="$sep"/> </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']"> + <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']"> <fo:block xsl:use-attribute-sets="admonition-p-style"> \ No newline at end of file