Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Aug 14, 2020
1 parent bb0991c commit 7c894c0
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 44 deletions.
235 changes: 192 additions & 43 deletions lib/isodoc/m3aawg/m3d.report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,8 @@
-->
<xsl:variable name="contents">
<contents>
<xsl:apply-templates select="/m3d:m3d-standard/m3d:preface/node()" mode="contents"/>

<xsl:apply-templates select="/m3d:m3d-standard/m3d:sections/m3d:clause[1]" mode="contents"/> <!-- [@id = '_scope'] -->

<!-- Normative references -->
<xsl:apply-templates select="/m3d:m3d-standard/m3d:bibliography/m3d:references[1]" mode="contents"/> <!-- [@id = '_normative_references'] -->

<xsl:apply-templates select="/m3d:m3d-standard/m3d:sections/*[position() &gt; 1]" mode="contents"/> <!-- @id != '_scope' -->

<xsl:apply-templates select="/m3d:m3d-standard/m3d:annex" mode="contents"/>

<!-- Bibliography -->
<xsl:apply-templates select="/m3d:m3d-standard/m3d:bibliography/m3d:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->


<xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
<xsl:call-template name="processMainSectionsDefault_Contents"/>
</contents>
</xsl:variable>

Expand Down Expand Up @@ -285,29 +272,14 @@
</fo:block>

<!-- Foreword, Introduction -->
<fo:block>
<xsl:apply-templates select="/m3d:m3d-standard/m3d:preface/node()"/>
<fo:block>
<xsl:call-template name="processPrefaceSectionsDefault"/>
</fo:block>

<fo:block break-after="page"/>

<xsl:apply-templates select="/m3d:m3d-standard/m3d:sections/m3d:clause[1]"/> <!-- Scope -->

<!-- Normative references -->
<xsl:if test="/m3d:m3d-standard/m3d:bibliography/m3d:references[1]">
<fo:block break-after="page"/>
<xsl:apply-templates select="/m3d:m3d-standard/m3d:bibliography/m3d:references[1]"/>
</xsl:if>

<!-- Main sections -->
<xsl:apply-templates select="/m3d:m3d-standard/m3d:sections/*[position() &gt; 1]"/>

<!-- Annex(s) -->
<xsl:apply-templates select="/m3d:m3d-standard/m3d:annex"/>
<xsl:call-template name="processMainSectionsDefault"/>

<!-- Bibliography -->
<xsl:apply-templates select="/m3d:m3d-standard/m3d:bibliography/m3d:references[position() &gt; 1]"/>

</fo:flow>
</fo:page-sequence>

Expand Down Expand Up @@ -584,13 +556,13 @@
<fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
<!-- <xsl:value-of select="@reference"/> -->
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@id='_normative_references' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
</fo:basic-link>
</fo:inline>
<fo:footnote-body>
<fo:block font-size="9pt" margin-bottom="12pt">
<fo:inline font-size="6pt" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super" padding-right="1mm">
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@id='_normative_references' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
</fo:inline>
<xsl:for-each select="m3d:p">
<xsl:apply-templates/>
Expand Down Expand Up @@ -737,7 +709,7 @@


<!-- <xsl:template match="m3d:references[@id = '_bibliography']"> -->
<xsl:template match="m3d:references[position() &gt; 1]">
<xsl:template match="m3d:references[not(@normative='true')]">
<fo:block break-after="page"/>
<fo:block id="{@id}">
<xsl:apply-templates/>
Expand All @@ -752,7 +724,7 @@

<!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
<!-- <xsl:template match="m3d:references[@id = '_bibliography']/m3d:bibitem"> -->
<xsl:template match="m3d:references[position() &gt; 1]/m3d:bibitem">
<xsl:template match="m3d:references[not(@normative='true')]/m3d:bibitem">
<fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
Expand Down Expand Up @@ -791,10 +763,10 @@
</xsl:template>

<!-- <xsl:template match="m3d:references[@id = '_bibliography']/m3d:bibitem" mode="contents"/> -->
<xsl:template match="m3d:references[position() &gt; 1]/m3d:bibitem" mode="contents"/>
<xsl:template match="m3d:references[not(@normative='true')]/m3d:bibitem" mode="contents"/>

<!-- <xsl:template match="m3d:references[@id = '_bibliography']/m3d:bibitem/m3d:title"> -->
<xsl:template match="m3d:references[position() &gt; 1]/m3d:bibitem/m3d:title">
<xsl:template match="m3d:references[not(@normative='true')]/m3d:bibitem/m3d:title">
<fo:inline font-style="italic">
<xsl:apply-templates/>
</fo:inline>
Expand Down Expand Up @@ -1051,6 +1023,7 @@
</xsl:attribute-set><xsl:attribute-set name="example-body-style">



</xsl:attribute-set><xsl:attribute-set name="example-name-style">


Expand All @@ -1068,6 +1041,8 @@







</xsl:attribute-set><xsl:attribute-set name="example-p-style">
Expand All @@ -1085,6 +1060,8 @@





</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">


Expand All @@ -1109,6 +1086,7 @@




</xsl:attribute-set><xsl:attribute-set name="appendix-style">

<xsl:attribute name="font-size">12pt</xsl:attribute>
Expand Down Expand Up @@ -1240,7 +1218,7 @@




</xsl:attribute-set><xsl:attribute-set name="formula-style">

</xsl:attribute-set><xsl:attribute-set name="image-style">
Expand Down Expand Up @@ -1284,7 +1262,47 @@
</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']"/>

<xsl:if test="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
<fo:block break-after="page"/>
</xsl:if>

<!-- 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"/>
Expand Down Expand Up @@ -1363,6 +1381,7 @@




<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">


Expand All @@ -1375,6 +1394,7 @@




<xsl:for-each select="xalan:nodeset($colwidths)//column">
<xsl:choose>
<xsl:when test=". = 1 or . = 0">
Expand Down Expand Up @@ -1625,6 +1645,15 @@
</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>




Expand All @@ -1649,6 +1678,14 @@
</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>



Expand Down Expand Up @@ -2845,6 +2882,117 @@
<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"/>
Expand Down Expand Up @@ -3127,7 +3275,7 @@
<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/>
Expand Down Expand Up @@ -3379,7 +3527,8 @@
<xsl:value-of select="document('')//*/namespace::m3d"/>





</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>
Expand Down
2 changes: 1 addition & 1 deletion lib/metanorma/m3aawg/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Metanorma
module M3AAWG
VERSION = "1.5.0"
VERSION = "1.5.1"
end
end

0 comments on commit 7c894c0

Please sign in to comment.