Skip to content

Commit

Permalink
xslt update based on metanorma/mn-native-pdf@99fb4dc
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 authored Jul 1, 2024
1 parent 24980e0 commit ac920e1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
23 changes: 20 additions & 3 deletions lib/isodoc/iso/iso.amendment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6884,19 +6884,27 @@
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>

</xsl:element>
</xsl:for-each>
</xsl:element>

<xsl:call-template name="insertAnnexInSeparatePageSequences"/>

<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>

<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->

<xsl:template name="insertAnnexInSeparatePageSequences">
<xsl:for-each select="/*/*[local-name()='annex']">
<xsl:sort select="@displayorder" data-type="number"/>
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
</xsl:element>
</xsl:for-each>

</xsl:template>
<xsl:template name="insertBibliographyInSeparatePageSequences">
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
<xsl:sort select="@displayorder" data-type="number"/>
Expand All @@ -6906,7 +6914,16 @@
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
</xsl:template>
<xsl:template name="insertIndexInSeparatePageSequences">
<xsl:for-each select="/*/*[local-name()='indexsect']">
<xsl:sort select="@displayorder" data-type="number"/>
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
</xsl:element>
</xsl:for-each>
</xsl:template>

<xsl:template name="processAllSectionsDefault_items">
<xsl:variable name="updated_xml_step_move_pagebreak">
Expand Down
23 changes: 20 additions & 3 deletions lib/isodoc/iso/iso.international-standard.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6884,19 +6884,27 @@
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>

</xsl:element>
</xsl:for-each>
</xsl:element>

<xsl:call-template name="insertAnnexInSeparatePageSequences"/>

<xsl:call-template name="insertBibliographyInSeparatePageSequences"/>

<!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->

<xsl:template name="insertAnnexInSeparatePageSequences">
<xsl:for-each select="/*/*[local-name()='annex']">
<xsl:sort select="@displayorder" data-type="number"/>
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
</xsl:element>
</xsl:for-each>

</xsl:template>
<xsl:template name="insertBibliographyInSeparatePageSequences">
<xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
<xsl:sort select="@displayorder" data-type="number"/>
Expand All @@ -6906,7 +6914,16 @@
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
</xsl:template>
<xsl:template name="insertIndexInSeparatePageSequences">
<xsl:for-each select="/*/*[local-name()='indexsect']">
<xsl:sort select="@displayorder" data-type="number"/>
<xsl:element name="page_sequence" namespace="{$namespace_full}">
<xsl:attribute name="main_page_sequence"/>
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
</xsl:element>
</xsl:for-each>
</xsl:template>

<xsl:template name="processAllSectionsDefault_items">
<xsl:variable name="updated_xml_step_move_pagebreak">
Expand Down

0 comments on commit ac920e1

Please sign in to comment.