metanorma-iho 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/base_convert.rb +0 -9
- data/lib/isodoc/iho/iho.specification.xsl +212 -28
- data/lib/isodoc/iho/iho.standard.xsl +212 -28
- data/lib/isodoc/iho/presentation_xml_convert.rb +7 -26
- data/lib/isodoc/iho/xref.rb +0 -1
- data/lib/metanorma/iho/converter.rb +2 -13
- data/lib/metanorma/iho/iho.rng +0 -5
- data/lib/metanorma/iho/isodoc.rng +16 -1
- data/lib/metanorma/iho/relaton-iho.rng +3 -0
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
@@ -696,6 +696,35 @@
|
|
696
696
|
<!-- ============================= -->
|
697
697
|
<!-- ============================= -->
|
698
698
|
|
699
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" priority="2" mode="update_xml_step1">
|
700
|
+
<xsl:copy>
|
701
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
702
|
+
</xsl:copy>
|
703
|
+
</xsl:template>
|
704
|
+
|
705
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" priority="2">
|
706
|
+
<xsl:call-template name="setNamedDestination"/>
|
707
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
708
|
+
<fo:block-container margin="2mm">
|
709
|
+
<fo:block-container margin="0">
|
710
|
+
<fo:block>
|
711
|
+
<xsl:apply-templates/>
|
712
|
+
</fo:block>
|
713
|
+
</fo:block-container>
|
714
|
+
</fo:block-container>
|
715
|
+
</fo:block-container>
|
716
|
+
</xsl:template>
|
717
|
+
|
718
|
+
<xsl:template match="*[local-name() = 'fmt-provision']" priority="2" mode="update_xml_step1">
|
719
|
+
<xsl:copy>
|
720
|
+
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
721
|
+
</xsl:copy>
|
722
|
+
</xsl:template>
|
723
|
+
|
724
|
+
<xsl:template match="*[local-name() = 'fmt-provision']/*[local-name() = 'div']" priority="2">
|
725
|
+
<fo:inline><xsl:copy-of select="@id"/><xsl:apply-templates/></fo:inline>
|
726
|
+
</xsl:template>
|
727
|
+
|
699
728
|
<xsl:template match="/iho:metanorma/iho:bibdata/iho:edition">
|
700
729
|
<xsl:call-template name="capitalize">
|
701
730
|
<xsl:with-param name="str">
|
@@ -842,6 +871,7 @@
|
|
842
871
|
<xsl:when test="$inline = 'true'">fo:inline</xsl:when>
|
843
872
|
<xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
|
844
873
|
<xsl:when test="local-name(..) = 'admonition'">fo:inline</xsl:when>
|
874
|
+
<xsl:when test="ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'] and not(preceding-sibling::*[local-name() = 'p'])">fo:inline</xsl:when>
|
845
875
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
846
876
|
</xsl:choose>
|
847
877
|
</xsl:variable>
|
@@ -883,6 +913,10 @@
|
|
883
913
|
<!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
|
884
914
|
</xsl:if>
|
885
915
|
|
916
|
+
<xsl:if test="ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'] and not(following-sibling::*)">
|
917
|
+
<xsl:attribute name="space-after">0pt</xsl:attribute>
|
918
|
+
</xsl:if>
|
919
|
+
|
886
920
|
<xsl:if test=".//iho:fn">
|
887
921
|
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
888
922
|
</xsl:if>
|
@@ -891,7 +925,7 @@
|
|
891
925
|
<xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
|
892
926
|
</xsl:apply-templates>
|
893
927
|
</xsl:element>
|
894
|
-
<xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
|
928
|
+
<xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition') and not(ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'])">
|
895
929
|
<fo:block margin-bottom="12pt">
|
896
930
|
<!-- <xsl:if test="ancestor::iho:annex">
|
897
931
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
@@ -1553,6 +1587,8 @@
|
|
1553
1587
|
|
1554
1588
|
<xsl:attribute-set name="permission-name-style">
|
1555
1589
|
|
1590
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1591
|
+
|
1556
1592
|
</xsl:attribute-set>
|
1557
1593
|
|
1558
1594
|
<xsl:attribute-set name="permission-label-style">
|
@@ -1566,6 +1602,8 @@
|
|
1566
1602
|
<xsl:attribute-set name="requirement-name-style">
|
1567
1603
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1568
1604
|
|
1605
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1606
|
+
|
1569
1607
|
</xsl:attribute-set>
|
1570
1608
|
|
1571
1609
|
<xsl:attribute-set name="requirement-label-style">
|
@@ -1598,10 +1636,14 @@
|
|
1598
1636
|
|
1599
1637
|
<xsl:attribute-set name="recommendation-style">
|
1600
1638
|
|
1639
|
+
<xsl:attribute name="border">1pt solid black</xsl:attribute>
|
1640
|
+
|
1601
1641
|
</xsl:attribute-set>
|
1602
1642
|
|
1603
1643
|
<xsl:attribute-set name="recommendation-name-style">
|
1604
1644
|
|
1645
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1646
|
+
|
1605
1647
|
</xsl:attribute-set>
|
1606
1648
|
|
1607
1649
|
<xsl:attribute-set name="recommendation-label-style">
|
@@ -1652,8 +1694,9 @@
|
|
1652
1694
|
|
1653
1695
|
<xsl:attribute-set name="example-p-style">
|
1654
1696
|
|
1655
|
-
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
1656
|
-
<xsl:attribute name="margin-left">12.7mm</xsl:attribute>
|
1697
|
+
<!-- <xsl:attribute name="font-size">11pt</xsl:attribute>
|
1698
|
+
<xsl:attribute name="margin-left">12.7mm</xsl:attribute> -->
|
1699
|
+
<xsl:attribute name="space-before">2pt</xsl:attribute>
|
1657
1700
|
|
1658
1701
|
</xsl:attribute-set> <!-- example-p-style -->
|
1659
1702
|
|
@@ -3364,8 +3407,14 @@
|
|
3364
3407
|
</xsl:choose>
|
3365
3408
|
</xsl:variable>
|
3366
3409
|
|
3410
|
+
<xsl:call-template name="setNamedDestination"/>
|
3411
|
+
|
3367
3412
|
<fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
|
3368
3413
|
|
3414
|
+
<xsl:for-each select="*[local-name() = 'name']">
|
3415
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
3416
|
+
</xsl:for-each>
|
3417
|
+
|
3369
3418
|
<xsl:call-template name="refine_table-container-style">
|
3370
3419
|
<xsl:with-param name="margin-side" select="$margin-side"/>
|
3371
3420
|
</xsl:call-template>
|
@@ -3570,6 +3619,7 @@
|
|
3570
3619
|
<!-- table/name-->
|
3571
3620
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3572
3621
|
<xsl:param name="continued"/>
|
3622
|
+
<xsl:param name="cols-count"/>
|
3573
3623
|
<xsl:if test="normalize-space() != ''">
|
3574
3624
|
|
3575
3625
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -3591,9 +3641,30 @@
|
|
3591
3641
|
|
3592
3642
|
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
3593
3643
|
<xsl:if test="$continued = 'true'">
|
3594
|
-
|
3595
|
-
|
3596
|
-
|
3644
|
+
|
3645
|
+
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
3646
|
+
|
3647
|
+
<xsl:choose>
|
3648
|
+
<xsl:when test="string(number($cols-count)) != 'NaN'">
|
3649
|
+
<fo:table width="100%" table-layout="fixed" role="SKIP">
|
3650
|
+
<fo:table-body role="SKIP">
|
3651
|
+
<fo:table-row>
|
3652
|
+
<fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
|
3653
|
+
<fo:block text-align="right" role="SKIP">
|
3654
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3655
|
+
</fo:block>
|
3656
|
+
</fo:table-cell>
|
3657
|
+
</fo:table-row>
|
3658
|
+
</fo:table-body>
|
3659
|
+
</fo:table>
|
3660
|
+
</xsl:when>
|
3661
|
+
<xsl:otherwise>
|
3662
|
+
<fo:block text-align="right">
|
3663
|
+
<xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
|
3664
|
+
</fo:block>
|
3665
|
+
</xsl:otherwise>
|
3666
|
+
</xsl:choose>
|
3667
|
+
|
3597
3668
|
</xsl:if>
|
3598
3669
|
<!-- </xsl:if> -->
|
3599
3670
|
|
@@ -3986,6 +4057,7 @@
|
|
3986
4057
|
|
3987
4058
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
|
3988
4059
|
<xsl:with-param name="continued">true</xsl:with-param>
|
4060
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
3989
4061
|
</xsl:apply-templates>
|
3990
4062
|
|
3991
4063
|
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
@@ -4367,8 +4439,8 @@
|
|
4367
4439
|
<xsl:for-each select="xalan:nodeset($styles__)/item">
|
4368
4440
|
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
|
4369
4441
|
<xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
|
4370
|
-
<xsl:if test="$key = 'color' or
|
4371
|
-
<style name="{$key}"><xsl:value-of select="$value"/></style>
|
4442
|
+
<xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
|
4443
|
+
<style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
|
4372
4444
|
</xsl:if>
|
4373
4445
|
</xsl:for-each>
|
4374
4446
|
</xsl:variable>
|
@@ -4432,6 +4504,7 @@
|
|
4432
4504
|
<!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
|
4433
4505
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
|
4434
4506
|
|
4507
|
+
<xsl:call-template name="setNamedDestination"/>
|
4435
4508
|
<fo:block xsl:use-attribute-sets="table-note-style">
|
4436
4509
|
<xsl:copy-of select="@id"/>
|
4437
4510
|
|
@@ -4957,7 +5030,7 @@
|
|
4957
5030
|
<xsl:variable name="target" select="@target"/>
|
4958
5031
|
<xsl:choose>
|
4959
5032
|
<!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
|
4960
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]
|
5033
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'][1]//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
|
4961
5034
|
<xsl:call-template name="fn">
|
4962
5035
|
<xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
|
4963
5036
|
</xsl:call-template>
|
@@ -5053,6 +5126,10 @@
|
|
5053
5126
|
<!-- <dl><xsl:copy-of select="."/></dl> -->
|
5054
5127
|
<fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
|
5055
5128
|
|
5129
|
+
<xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
|
5130
|
+
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
|
5131
|
+
</xsl:if>
|
5132
|
+
|
5056
5133
|
<xsl:call-template name="setBlockSpanAll"/>
|
5057
5134
|
|
5058
5135
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -5348,7 +5425,7 @@
|
|
5348
5425
|
|
5349
5426
|
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
5350
5427
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
5351
|
-
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
5428
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
|
5352
5429
|
<xsl:call-template name="refine_figure_key_style"/>
|
5353
5430
|
<xsl:apply-templates/>
|
5354
5431
|
</fo:block>
|
@@ -5603,6 +5680,7 @@
|
|
5603
5680
|
|
5604
5681
|
<xsl:call-template name="refine_dt-cell-style"/>
|
5605
5682
|
|
5683
|
+
<xsl:call-template name="setNamedDestination"/>
|
5606
5684
|
<fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
|
5607
5685
|
|
5608
5686
|
<xsl:choose>
|
@@ -6038,7 +6116,7 @@
|
|
6038
6116
|
<!-- ================= -->
|
6039
6117
|
|
6040
6118
|
<!-- highlight text -->
|
6041
|
-
<xsl:template match="*[local-name()='hi']">
|
6119
|
+
<xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
|
6042
6120
|
<fo:inline background-color="yellow">
|
6043
6121
|
<xsl:apply-templates/>
|
6044
6122
|
</fo:inline>
|
@@ -7704,6 +7782,7 @@
|
|
7704
7782
|
<!-- Appendix processing -->
|
7705
7783
|
<!-- ======================== -->
|
7706
7784
|
<xsl:template match="*[local-name()='appendix']">
|
7785
|
+
<xsl:call-template name="setNamedDestination"/>
|
7707
7786
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
7708
7787
|
<xsl:apply-templates select="*[local-name()='title']"/>
|
7709
7788
|
</fo:block>
|
@@ -7714,13 +7793,14 @@
|
|
7714
7793
|
<xsl:variable name="level">
|
7715
7794
|
<xsl:call-template name="getLevel"/>
|
7716
7795
|
</xsl:variable>
|
7717
|
-
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
|
7796
|
+
<fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
|
7718
7797
|
</xsl:template>
|
7719
7798
|
<!-- ======================== -->
|
7720
7799
|
<!-- END Appendix processing -->
|
7721
7800
|
<!-- ======================== -->
|
7722
7801
|
|
7723
7802
|
<xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
|
7803
|
+
<xsl:call-template name="setNamedDestination"/>
|
7724
7804
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
|
7725
7805
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
7726
7806
|
</fo:block>
|
@@ -7750,6 +7830,7 @@
|
|
7750
7830
|
<xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
|
7751
7831
|
<xsl:param name="callout"/>
|
7752
7832
|
<fo:inline id="{@id}">
|
7833
|
+
<xsl:call-template name="setNamedDestination"/>
|
7753
7834
|
<!-- for first p in annotation, put <x> -->
|
7754
7835
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
7755
7836
|
<xsl:apply-templates/>
|
@@ -7796,6 +7877,7 @@
|
|
7796
7877
|
|
7797
7878
|
</xsl:if>
|
7798
7879
|
<fo:block-container margin-left="0mm" role="SKIP">
|
7880
|
+
<xsl:call-template name="setNamedDestination"/>
|
7799
7881
|
<fo:block id="{@id}">
|
7800
7882
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
|
7801
7883
|
</fo:block>
|
@@ -7841,8 +7923,13 @@
|
|
7841
7923
|
</fo:block>
|
7842
7924
|
</fo:table-cell>
|
7843
7925
|
<fo:table-cell display-align="center">
|
7926
|
+
|
7844
7927
|
<fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
|
7845
7928
|
|
7929
|
+
<xsl:for-each select="../*[local-name() = 'name']">
|
7930
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
7931
|
+
</xsl:for-each>
|
7932
|
+
|
7846
7933
|
<xsl:call-template name="refine_formula-stem-number-style"/>
|
7847
7934
|
|
7848
7935
|
<xsl:apply-templates select="../*[local-name() = 'name']"/>
|
@@ -7877,6 +7964,8 @@
|
|
7877
7964
|
|
7878
7965
|
<xsl:template match="*[local-name() = 'note']" name="note">
|
7879
7966
|
|
7967
|
+
<xsl:call-template name="setNamedDestination"/>
|
7968
|
+
|
7880
7969
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
|
7881
7970
|
|
7882
7971
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -7941,6 +8030,7 @@
|
|
7941
8030
|
</xsl:template>
|
7942
8031
|
|
7943
8032
|
<xsl:template match="*[local-name() = 'termnote']">
|
8033
|
+
<xsl:call-template name="setNamedDestination"/>
|
7944
8034
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
7945
8035
|
|
7946
8036
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -8047,12 +8137,14 @@
|
|
8047
8137
|
|
8048
8138
|
<xsl:template match="*[local-name() = 'terms']">
|
8049
8139
|
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
8140
|
+
<xsl:call-template name="setNamedDestination"/>
|
8050
8141
|
<fo:block id="{@id}">
|
8051
8142
|
<xsl:apply-templates/>
|
8052
8143
|
</fo:block>
|
8053
8144
|
</xsl:template>
|
8054
8145
|
|
8055
8146
|
<xsl:template match="*[local-name() = 'term']">
|
8147
|
+
<xsl:call-template name="setNamedDestination"/>
|
8056
8148
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
8057
8149
|
|
8058
8150
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
@@ -8084,6 +8176,7 @@
|
|
8084
8176
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
8085
8177
|
<xsl:variable name="isAdded" select="@added"/>
|
8086
8178
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
8179
|
+
<xsl:call-template name="setNamedDestination"/>
|
8087
8180
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
8088
8181
|
<xsl:call-template name="refine_figure-block-style"/>
|
8089
8182
|
|
@@ -8100,6 +8193,11 @@
|
|
8100
8193
|
</xsl:variable>
|
8101
8194
|
|
8102
8195
|
<fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
|
8196
|
+
|
8197
|
+
<xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
|
8198
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
8199
|
+
</xsl:for-each>
|
8200
|
+
|
8103
8201
|
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
8104
8202
|
</fo:block>
|
8105
8203
|
|
@@ -8132,6 +8230,7 @@
|
|
8132
8230
|
</xsl:template>
|
8133
8231
|
|
8134
8232
|
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
|
8233
|
+
<xsl:call-template name="setNamedDestination"/>
|
8135
8234
|
<fo:block id="{@id}">
|
8136
8235
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8137
8236
|
</fo:block>
|
@@ -8145,6 +8244,7 @@
|
|
8145
8244
|
</xsl:template>
|
8146
8245
|
|
8147
8246
|
<!-- SOURCE: ... -->
|
8247
|
+
<!-- figure/source -->
|
8148
8248
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
|
8149
8249
|
|
8150
8250
|
<xsl:call-template name="termsource"/>
|
@@ -9377,6 +9477,7 @@
|
|
9377
9477
|
<xsl:template match="title" mode="bookmark"/>
|
9378
9478
|
<xsl:template match="text()" mode="bookmark"/>
|
9379
9479
|
|
9480
|
+
<!-- figure/name -->
|
9380
9481
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
|
9381
9482
|
<xsl:if test="normalize-space() != ''">
|
9382
9483
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -10092,6 +10193,7 @@
|
|
10092
10193
|
<!-- permission -->
|
10093
10194
|
<!-- ========== -->
|
10094
10195
|
<xsl:template match="*[local-name() = 'permission']">
|
10196
|
+
<xsl:call-template name="setNamedDestination"/>
|
10095
10197
|
<fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
|
10096
10198
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
10097
10199
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -10100,10 +10202,11 @@
|
|
10100
10202
|
|
10101
10203
|
<xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
|
10102
10204
|
<xsl:if test="normalize-space() != ''">
|
10103
|
-
<fo:block xsl:use-attribute-sets="permission-name-style">
|
10104
|
-
<xsl:apply-templates/>
|
10105
10205
|
|
10106
|
-
|
10206
|
+
<fo:inline xsl:use-attribute-sets="permission-name-style">
|
10207
|
+
<xsl:apply-templates/><xsl:text>:</xsl:text>
|
10208
|
+
</fo:inline>
|
10209
|
+
|
10107
10210
|
</xsl:if>
|
10108
10211
|
</xsl:template>
|
10109
10212
|
|
@@ -10119,6 +10222,7 @@
|
|
10119
10222
|
<!-- requirement -->
|
10120
10223
|
<!-- ========== -->
|
10121
10224
|
<xsl:template match="*[local-name() = 'requirement']">
|
10225
|
+
<xsl:call-template name="setNamedDestination"/>
|
10122
10226
|
<fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
|
10123
10227
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
10124
10228
|
<xsl:apply-templates select="*[local-name()='label']"/>
|
@@ -10130,11 +10234,11 @@
|
|
10130
10234
|
|
10131
10235
|
<xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
|
10132
10236
|
<xsl:if test="normalize-space() != ''">
|
10133
|
-
<fo:block xsl:use-attribute-sets="requirement-name-style">
|
10134
10237
|
|
10135
|
-
|
10238
|
+
<fo:inline xsl:use-attribute-sets="requirement-name-style">
|
10239
|
+
<xsl:apply-templates/><xsl:text>:</xsl:text>
|
10240
|
+
</fo:inline>
|
10136
10241
|
|
10137
|
-
</fo:block>
|
10138
10242
|
</xsl:if>
|
10139
10243
|
</xsl:template>
|
10140
10244
|
|
@@ -10163,6 +10267,7 @@
|
|
10163
10267
|
<!-- recommendation -->
|
10164
10268
|
<!-- ========== -->
|
10165
10269
|
<xsl:template match="*[local-name() = 'recommendation']">
|
10270
|
+
<xsl:call-template name="setNamedDestination"/>
|
10166
10271
|
<fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
|
10167
10272
|
<xsl:apply-templates select="*[local-name()='name']"/>
|
10168
10273
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
@@ -10171,10 +10276,11 @@
|
|
10171
10276
|
|
10172
10277
|
<xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
|
10173
10278
|
<xsl:if test="normalize-space() != ''">
|
10174
|
-
<fo:block xsl:use-attribute-sets="recommendation-name-style">
|
10175
|
-
<xsl:apply-templates/>
|
10176
10279
|
|
10177
|
-
|
10280
|
+
<fo:inline xsl:use-attribute-sets="recommendation-name-style">
|
10281
|
+
<xsl:apply-templates/><xsl:text>:</xsl:text>
|
10282
|
+
</fo:inline>
|
10283
|
+
|
10178
10284
|
</xsl:if>
|
10179
10285
|
</xsl:template>
|
10180
10286
|
|
@@ -10253,6 +10359,7 @@
|
|
10253
10359
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
10254
10360
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
10255
10361
|
</xsl:if>
|
10362
|
+
<xsl:call-template name="setNamedDestination"/>
|
10256
10363
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
10257
10364
|
<fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
|
10258
10365
|
<xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
|
@@ -10362,6 +10469,7 @@
|
|
10362
10469
|
<!-- termexample -->
|
10363
10470
|
<!-- ====== -->
|
10364
10471
|
<xsl:template match="*[local-name() = 'termexample']">
|
10472
|
+
<xsl:call-template name="setNamedDestination"/>
|
10365
10473
|
<fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
|
10366
10474
|
<xsl:call-template name="refine_termexample-style"/>
|
10367
10475
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -10416,6 +10524,7 @@
|
|
10416
10524
|
-->
|
10417
10525
|
<xsl:template match="*[local-name() = 'example']" name="example">
|
10418
10526
|
|
10527
|
+
<xsl:call-template name="setNamedDestination"/>
|
10419
10528
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
|
10420
10529
|
|
10421
10530
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -10936,8 +11045,13 @@
|
|
10936
11045
|
<fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
|
10937
11046
|
|
10938
11047
|
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
|
11048
|
+
|
10939
11049
|
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
|
10940
11050
|
|
11051
|
+
<xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
|
11052
|
+
<xsl:call-template name="setIDforNamedDestination"/>
|
11053
|
+
</xsl:for-each>
|
11054
|
+
|
10941
11055
|
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
|
10942
11056
|
</fo:block>
|
10943
11057
|
</xsl:if>
|
@@ -11057,6 +11171,7 @@
|
|
11057
11171
|
<!-- main sections -->
|
11058
11172
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
11059
11173
|
|
11174
|
+
<xsl:call-template name="setNamedDestination"/>
|
11060
11175
|
<fo:block>
|
11061
11176
|
<xsl:call-template name="setId"/>
|
11062
11177
|
|
@@ -11097,6 +11212,7 @@
|
|
11097
11212
|
|
11098
11213
|
<fo:block break-after="page"/>
|
11099
11214
|
|
11215
|
+
<xsl:call-template name="setNamedDestination"/>
|
11100
11216
|
<fo:block>
|
11101
11217
|
<xsl:call-template name="setId"/>
|
11102
11218
|
<xsl:call-template name="addReviewHelper"/>
|
@@ -11125,6 +11241,7 @@
|
|
11125
11241
|
</xsl:template>
|
11126
11242
|
|
11127
11243
|
<xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
|
11244
|
+
<xsl:call-template name="setNamedDestination"/>
|
11128
11245
|
<fo:block>
|
11129
11246
|
<xsl:if test="parent::*[local-name() = 'copyright-statement']">
|
11130
11247
|
<xsl:attribute name="role">SKIP</xsl:attribute>
|
@@ -11147,6 +11264,7 @@
|
|
11147
11264
|
</xsl:template> <!-- refine_clause_style -->
|
11148
11265
|
|
11149
11266
|
<xsl:template match="*[local-name() = 'definitions']">
|
11267
|
+
<xsl:call-template name="setNamedDestination"/>
|
11150
11268
|
<fo:block id="{@id}">
|
11151
11269
|
<xsl:apply-templates/>
|
11152
11270
|
</fo:block>
|
@@ -11162,6 +11280,8 @@
|
|
11162
11280
|
<xsl:otherwise>
|
11163
11281
|
|
11164
11282
|
<fo:block break-after="page"/>
|
11283
|
+
<xsl:call-template name="setNamedDestination"/>
|
11284
|
+
|
11165
11285
|
<fo:block id="{@id}">
|
11166
11286
|
|
11167
11287
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -11233,6 +11353,7 @@
|
|
11233
11353
|
<!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
|
11234
11354
|
following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
|
11235
11355
|
<!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
|
11356
|
+
<xsl:call-template name="setNamedDestination"/>
|
11236
11357
|
<fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11237
11358
|
<!-- </xsl:if> -->
|
11238
11359
|
</xsl:if>
|
@@ -11951,6 +12072,7 @@
|
|
11951
12072
|
<!-- Normative references -->
|
11952
12073
|
<xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
|
11953
12074
|
|
12075
|
+
<xsl:call-template name="setNamedDestination"/>
|
11954
12076
|
<fo:block id="{@id}">
|
11955
12077
|
<xsl:apply-templates/>
|
11956
12078
|
|
@@ -11969,6 +12091,7 @@
|
|
11969
12091
|
</xsl:if>
|
11970
12092
|
</xsl:if> -->
|
11971
12093
|
|
12094
|
+
<xsl:call-template name="setNamedDestination"/>
|
11972
12095
|
<fo:block id="{@id}"/>
|
11973
12096
|
|
11974
12097
|
<xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
|
@@ -11988,6 +12111,7 @@
|
|
11988
12111
|
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
|
11989
12112
|
<xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
|
11990
12113
|
|
12114
|
+
<xsl:call-template name="setNamedDestination"/>
|
11991
12115
|
<fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-normative-list-style">
|
11992
12116
|
|
11993
12117
|
<xsl:variable name="docidentifier">
|
@@ -12037,6 +12161,7 @@
|
|
12037
12161
|
<xsl:choose>
|
12038
12162
|
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
|
12039
12163
|
<xsl:otherwise>
|
12164
|
+
<xsl:call-template name="setNamedDestination"/>
|
12040
12165
|
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
|
12041
12166
|
|
12042
12167
|
<fo:list-item-label end-indent="label-end()">
|
@@ -12431,6 +12556,7 @@
|
|
12431
12556
|
<xsl:template match="*[local-name() = 'admonition']">
|
12432
12557
|
|
12433
12558
|
<!-- text in the box -->
|
12559
|
+
<xsl:call-template name="setNamedDestination"/>
|
12434
12560
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
|
12435
12561
|
|
12436
12562
|
<xsl:call-template name="setBlockSpanAll"/>
|
@@ -12684,7 +12810,7 @@
|
|
12684
12810
|
</xsl:template>
|
12685
12811
|
|
12686
12812
|
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12687
|
-
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
12813
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
|
12688
12814
|
<xsl:copy>
|
12689
12815
|
<xsl:copy-of select="@*"/>
|
12690
12816
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -12716,28 +12842,56 @@
|
|
12716
12842
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
12717
12843
|
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
12718
12844
|
|
12719
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
12845
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
|
12720
12846
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
12721
12847
|
<xsl:copy-of select="@*"/>
|
12722
12848
|
<xsl:choose>
|
12723
12849
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
12724
|
-
<xsl:
|
12850
|
+
<xsl:choose>
|
12851
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12852
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
12853
|
+
</xsl:when>
|
12854
|
+
<xsl:otherwise>
|
12855
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
|
12856
|
+
</xsl:otherwise>
|
12857
|
+
</xsl:choose>
|
12725
12858
|
</xsl:when>
|
12726
12859
|
<xsl:otherwise>
|
12727
|
-
<xsl:
|
12860
|
+
<xsl:choose>
|
12861
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12862
|
+
<xsl:copy-of select="node()"/>
|
12863
|
+
</xsl:when>
|
12864
|
+
<xsl:otherwise>
|
12865
|
+
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
12866
|
+
</xsl:otherwise>
|
12867
|
+
</xsl:choose>
|
12728
12868
|
</xsl:otherwise>
|
12729
12869
|
</xsl:choose>
|
12730
12870
|
</xsl:element>
|
12731
12871
|
</xsl:template>
|
12732
|
-
<xsl:template match="*[local-name() = 'fmt-stem']
|
12872
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
|
12733
12873
|
<xsl:element name="stem" namespace="{$namespace_full}">
|
12734
12874
|
<xsl:copy-of select="@*"/>
|
12735
12875
|
<xsl:choose>
|
12736
12876
|
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
12737
|
-
<xsl:
|
12877
|
+
<xsl:choose>
|
12878
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12879
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
12880
|
+
</xsl:when>
|
12881
|
+
<xsl:otherwise>
|
12882
|
+
<xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
|
12883
|
+
</xsl:otherwise>
|
12884
|
+
</xsl:choose>
|
12738
12885
|
</xsl:when>
|
12739
12886
|
<xsl:otherwise>
|
12740
|
-
<xsl:
|
12887
|
+
<xsl:choose>
|
12888
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
|
12889
|
+
<xsl:copy-of select="node()"/>
|
12890
|
+
</xsl:when>
|
12891
|
+
<xsl:otherwise>
|
12892
|
+
<xsl:apply-templates select="node()" mode="update_xml_pres"/>
|
12893
|
+
</xsl:otherwise>
|
12894
|
+
</xsl:choose>
|
12741
12895
|
</xsl:otherwise>
|
12742
12896
|
</xsl:choose>
|
12743
12897
|
</xsl:element>
|
@@ -12966,16 +13120,24 @@
|
|
12966
13120
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
|
12967
13121
|
<xsl:element name="title" namespace="{$namespace_full}">
|
12968
13122
|
<xsl:copy-of select="@*"/>
|
13123
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
13124
|
+
|
12969
13125
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12970
13126
|
</xsl:element>
|
12971
13127
|
</xsl:template>
|
12972
13128
|
<xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
|
12973
13129
|
<xsl:element name="title" namespace="{$namespace_full}">
|
12974
13130
|
<xsl:copy-of select="@*"/>
|
13131
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
13132
|
+
|
12975
13133
|
<xsl:apply-templates mode="update_xml_pres"/>
|
12976
13134
|
</xsl:element>
|
12977
13135
|
</xsl:template>
|
12978
13136
|
|
13137
|
+
<xsl:template name="addNamedDestinationAttribute">
|
13138
|
+
|
13139
|
+
</xsl:template>
|
13140
|
+
|
12979
13141
|
<xsl:template match="*[local-name() = 'fmt-name']"/>
|
12980
13142
|
<xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
|
12981
13143
|
<xsl:choose>
|
@@ -12985,6 +13147,8 @@
|
|
12985
13147
|
<xsl:otherwise>
|
12986
13148
|
<xsl:element name="name" namespace="{$namespace_full}">
|
12987
13149
|
<xsl:copy-of select="@*"/>
|
13150
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
13151
|
+
|
12988
13152
|
<xsl:apply-templates mode="update_xml_step1"/>
|
12989
13153
|
</xsl:element>
|
12990
13154
|
</xsl:otherwise>
|
@@ -12998,6 +13162,8 @@
|
|
12998
13162
|
<xsl:otherwise>
|
12999
13163
|
<xsl:element name="name" namespace="{$namespace_full}">
|
13000
13164
|
<xsl:copy-of select="@*"/>
|
13165
|
+
<xsl:call-template name="addNamedDestinationAttribute"/>
|
13166
|
+
|
13001
13167
|
<xsl:apply-templates mode="update_xml_pres"/>
|
13002
13168
|
</xsl:element>
|
13003
13169
|
</xsl:otherwise>
|
@@ -14455,6 +14621,24 @@
|
|
14455
14621
|
</xsl:attribute>
|
14456
14622
|
</xsl:template>
|
14457
14623
|
|
14624
|
+
<xsl:template name="setIDforNamedDestination">
|
14625
|
+
<xsl:if test="@named_dest">
|
14626
|
+
<xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
|
14627
|
+
</xsl:if>
|
14628
|
+
</xsl:template>
|
14629
|
+
|
14630
|
+
<xsl:template name="setNamedDestination">
|
14631
|
+
<!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
|
14632
|
+
<xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
|
14633
|
+
<fox:destination internal-destination="{@id}"/>
|
14634
|
+
</xsl:if>
|
14635
|
+
<xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
|
14636
|
+
<xsl:if test="@named_dest">
|
14637
|
+
<fox:destination internal-destination="{@named_dest}"/>
|
14638
|
+
</xsl:if>
|
14639
|
+
</xsl:for-each>
|
14640
|
+
</xsl:template>
|
14641
|
+
|
14458
14642
|
<xsl:template name="add-letter-spacing">
|
14459
14643
|
<xsl:param name="text"/>
|
14460
14644
|
<xsl:param name="letter-spacing" select="'0.15'"/>
|