metanorma-iho 0.7.3 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/html/htmlstyle.css +4 -0
- data/lib/isodoc/iho/html/htmlstyle.scss +6 -0
- data/lib/isodoc/iho/iho.specification.xsl +148 -48
- data/lib/isodoc/iho/iho.standard.xsl +148 -48
- data/lib/isodoc/iho/presentation_xml_convert.rb +2 -2
- data/lib/metanorma/iho/basicdoc.rng +0 -1
- data/lib/metanorma/iho/biblio.rng +11 -1
- data/lib/metanorma/iho/converter.rb +12 -5
- data/lib/metanorma/iho/isodoc.rng +11 -0
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12eb31ff59fda5679c4aad936fdd15576d12967a8453842c4fbf75e4c48ae18e
|
4
|
+
data.tar.gz: dc8fa3b74a13882d829ab20660225e06b21537d1059df84d0e9791360ca2b311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77d8b4f49f0cd3b15d4fb93a21192851005ddccc21bbc693dcac5835656ec7dd491b3dcd06eb48d2e769763373da56b3d0e1ac07d5d1188ec5db88f2622ba677
|
7
|
+
data.tar.gz: 793feae3e390979825af2d19755b995aefc693238837a4b39182021f0e5b5d83e89acdd3302292bb69754732170575ea532971f8764b5821a40bcc1af08423d5
|
@@ -357,6 +357,7 @@
|
|
357
357
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']"/>
|
358
358
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]"/>
|
359
359
|
|
360
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
360
361
|
</fo:block-container>
|
361
362
|
</fo:flow>
|
362
363
|
</fo:page-sequence>
|
@@ -373,6 +374,8 @@
|
|
373
374
|
<fo:flow flow-name="xsl-region-body">
|
374
375
|
<fo:block-container>
|
375
376
|
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
377
|
+
|
378
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
376
379
|
</fo:block-container>
|
377
380
|
</fo:flow>
|
378
381
|
</fo:page-sequence>
|
@@ -390,6 +393,8 @@
|
|
390
393
|
<fo:block-container>
|
391
394
|
<!-- Bibliography -->
|
392
395
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
396
|
+
|
397
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
393
398
|
</fo:block-container>
|
394
399
|
</fo:flow>
|
395
400
|
</fo:page-sequence>
|
@@ -2639,7 +2644,7 @@
|
|
2639
2644
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
2640
2645
|
|
2641
2646
|
<xsl:choose>
|
2642
|
-
<xsl:when test="@width">
|
2647
|
+
<xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
|
2643
2648
|
|
2644
2649
|
<!-- centered table when table name is centered (see table-name-style) -->
|
2645
2650
|
|
@@ -2964,6 +2969,7 @@
|
|
2964
2969
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
2965
2970
|
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
2966
2971
|
<!-- difference between the available space and the minimum table width -->
|
2972
|
+
<_width_min><xsl:value-of select="@width_min"/></_width_min>
|
2967
2973
|
<xsl:variable name="W" select="$page_width - @width_min"/>
|
2968
2974
|
<W><xsl:value-of select="$W"/></W>
|
2969
2975
|
<!-- difference between maximum and minimum width of the table -->
|
@@ -3581,17 +3587,20 @@
|
|
3581
3587
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
3582
3588
|
<xsl:variable name="reference" select="@reference"/>
|
3583
3589
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3584
|
-
<fo:block xsl:use-attribute-sets="table-fn-style">
|
3585
3590
|
|
3586
|
-
|
3591
|
+
<fo:block xsl:use-attribute-sets="table-fn-style">
|
3587
3592
|
|
3588
|
-
|
3593
|
+
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
|
3594
|
+
|
3595
|
+
<xsl:value-of select="@reference"/>
|
3596
|
+
|
3597
|
+
</fo:inline>
|
3598
|
+
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
3599
|
+
<xsl:copy-of select="./node()"/>
|
3600
|
+
</fo:inline>
|
3601
|
+
|
3602
|
+
</fo:block>
|
3589
3603
|
|
3590
|
-
</fo:inline>
|
3591
|
-
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
3592
|
-
<xsl:copy-of select="./node()"/>
|
3593
|
-
</fo:inline>
|
3594
|
-
</fo:block>
|
3595
3604
|
</xsl:if>
|
3596
3605
|
</xsl:for-each>
|
3597
3606
|
</xsl:template>
|
@@ -4534,12 +4543,12 @@
|
|
4534
4543
|
<xsl:param name="value"/>
|
4535
4544
|
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
4536
4545
|
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
4537
|
-
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-
|
4538
|
-
<xsl:attribute name="height">5mm</xsl:attribute>
|
4546
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
|
4547
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
|
4539
4548
|
<xsl:attribute name="content-width">100%</xsl:attribute>
|
4540
4549
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4541
4550
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4542
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4551
|
+
<!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4543
4552
|
<g>
|
4544
4553
|
<xsl:if test="$type = 'closing' or $type = 'end'">
|
4545
4554
|
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
@@ -4553,6 +4562,27 @@
|
|
4553
4562
|
</xsl:if>
|
4554
4563
|
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
4555
4564
|
</text>
|
4565
|
+
</svg> -->
|
4566
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4567
|
+
<g>
|
4568
|
+
<xsl:if test="$type = 'closing' or $type = 'end'">
|
4569
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
4570
|
+
</xsl:if>
|
4571
|
+
<polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
|
4572
|
+
<line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
|
4573
|
+
</g>
|
4574
|
+
<xsl:variable name="text_x">
|
4575
|
+
<xsl:choose>
|
4576
|
+
<xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
|
4577
|
+
<xsl:otherwise>22</xsl:otherwise>
|
4578
|
+
</xsl:choose>
|
4579
|
+
</xsl:variable>
|
4580
|
+
<text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
|
4581
|
+
<xsl:value-of select="$kind"/>
|
4582
|
+
</text>
|
4583
|
+
<text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
|
4584
|
+
<xsl:value-of select="$value"/>
|
4585
|
+
</text>
|
4556
4586
|
</svg>
|
4557
4587
|
</fo:instream-foreign-object>
|
4558
4588
|
</xsl:template>
|
@@ -4621,7 +4651,7 @@
|
|
4621
4651
|
</xsl:copy>
|
4622
4652
|
</xsl:template>
|
4623
4653
|
|
4624
|
-
<xsl:template match="*[local-name() = 'pagebreak']" mode="landscape_portrait">
|
4654
|
+
<xsl:template match="*[local-name() = 'pagebreak'][not(following-sibling::*[1][local-name() = 'pagebreak'])]" mode="landscape_portrait">
|
4625
4655
|
|
4626
4656
|
<!-- determine pagebreak is last element before </fo:flow> or not -->
|
4627
4657
|
<xsl:variable name="isLast">
|
@@ -4633,16 +4663,18 @@
|
|
4633
4663
|
<xsl:if test="contains($isLast, 'false')">
|
4634
4664
|
|
4635
4665
|
<xsl:variable name="orientation" select="normalize-space(@orientation)"/>
|
4636
|
-
|
4666
|
+
|
4667
|
+
<xsl:variable name="tree_">
|
4637
4668
|
<xsl:for-each select="ancestor::*[ancestor::fo:flow]">
|
4638
4669
|
<element pos="{position()}">
|
4639
4670
|
<xsl:value-of select="name()"/>
|
4640
4671
|
</element>
|
4641
4672
|
</xsl:for-each>
|
4642
4673
|
</xsl:variable>
|
4674
|
+
<xsl:variable name="tree" select="xalan:nodeset($tree_)"/>
|
4643
4675
|
|
4644
4676
|
<!-- close fo:page-sequence (closing preceding fo elements) -->
|
4645
|
-
<xsl:for-each select="
|
4677
|
+
<xsl:for-each select="$tree//element">
|
4646
4678
|
<xsl:sort data-type="number" order="descending" select="@pos"/>
|
4647
4679
|
<xsl:text disable-output-escaping="yes"></</xsl:text>
|
4648
4680
|
<xsl:value-of select="."/>
|
@@ -4653,7 +4685,6 @@
|
|
4653
4685
|
|
4654
4686
|
<!-- <pagebreak/> -->
|
4655
4687
|
<!-- create a new fo:page-sequence (opening fo elements) -->
|
4656
|
-
|
4657
4688
|
<xsl:text disable-output-escaping="yes"><fo:page-sequence master-reference="document</xsl:text><xsl:if test="$orientation != ''">-<xsl:value-of select="$orientation"/></xsl:if><xsl:text disable-output-escaping="yes">"></xsl:text>
|
4658
4689
|
<fo:static-content flow-name="xsl-footnote-separator">
|
4659
4690
|
<fo:block>
|
@@ -4663,7 +4694,7 @@
|
|
4663
4694
|
<xsl:call-template name="insertHeaderFooter"/>
|
4664
4695
|
<xsl:text disable-output-escaping="yes"><fo:flow flow-name="xsl-region-body"></xsl:text>
|
4665
4696
|
|
4666
|
-
<xsl:for-each select="
|
4697
|
+
<xsl:for-each select="$tree//element">
|
4667
4698
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
4668
4699
|
<xsl:value-of select="."/>
|
4669
4700
|
<xsl:for-each select="@*[local-name() != 'pos']">
|
@@ -4675,6 +4706,7 @@
|
|
4675
4706
|
</xsl:for-each>
|
4676
4707
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
4677
4708
|
</xsl:for-each>
|
4709
|
+
|
4678
4710
|
</xsl:if>
|
4679
4711
|
</xsl:template>
|
4680
4712
|
<!-- ================================================================ -->
|
@@ -4876,18 +4908,23 @@
|
|
4876
4908
|
|
4877
4909
|
<xsl:template name="add-zero-spaces-java">
|
4878
4910
|
<xsl:param name="text" select="."/>
|
4879
|
-
|
4880
|
-
|
4911
|
+
|
4912
|
+
<!-- add zero-width space (#x200B) after dot with next non-digit -->
|
4913
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1$2')"/>
|
4914
|
+
<!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
|
4915
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1')"/>
|
4916
|
+
<!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
|
4917
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1$2')"/>
|
4881
4918
|
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
4882
|
-
<xsl:variable name="
|
4919
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
4883
4920
|
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
4884
|
-
<xsl:variable name="
|
4921
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
4885
4922
|
<!-- add zero-width space (#x200B) before character: { -->
|
4886
|
-
<xsl:variable name="
|
4923
|
+
<xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
4887
4924
|
<!-- add zero-width space (#x200B) after character: , -->
|
4888
|
-
<xsl:variable name="
|
4925
|
+
<xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
4889
4926
|
|
4890
|
-
<xsl:value-of select="$
|
4927
|
+
<xsl:value-of select="$text7"/>
|
4891
4928
|
</xsl:template>
|
4892
4929
|
|
4893
4930
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -4896,7 +4933,9 @@
|
|
4896
4933
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
4897
4934
|
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
4898
4935
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4899
|
-
<xsl:
|
4936
|
+
<xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
4937
|
+
<!-- remove zero-width space at the end -->
|
4938
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '$', '')"/>
|
4900
4939
|
</xsl:template>
|
4901
4940
|
|
4902
4941
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -5033,7 +5072,7 @@
|
|
5033
5072
|
</xsl:copy>
|
5034
5073
|
</xsl:template>
|
5035
5074
|
|
5036
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
5075
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
|
5037
5076
|
<xsl:copy>
|
5038
5077
|
<xsl:copy-of select="@*"/>
|
5039
5078
|
<p>
|
@@ -5109,6 +5148,14 @@
|
|
5109
5148
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
|
5110
5149
|
</xsl:template>
|
5111
5150
|
|
5151
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
|
5152
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5153
|
+
</xsl:template>
|
5154
|
+
|
5155
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
|
5156
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5157
|
+
</xsl:template>
|
5158
|
+
|
5112
5159
|
<!-- mode="table-without-br" -->
|
5113
5160
|
<!-- ================================== -->
|
5114
5161
|
<!-- END: Step 0. replace <br/> to <p>...</p> -->
|
@@ -5922,7 +5969,7 @@
|
|
5922
5969
|
|
5923
5970
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
|
5924
5971
|
|
5925
|
-
<fo:block-container margin-left="0mm">
|
5972
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
5926
5973
|
|
5927
5974
|
<fo:block>
|
5928
5975
|
|
@@ -6098,11 +6145,14 @@
|
|
6098
6145
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
6099
6146
|
</xsl:call-template>
|
6100
6147
|
|
6148
|
+
<!-- Example: Dimensions in millimeters -->
|
6149
|
+
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
6150
|
+
|
6101
6151
|
<fo:block xsl:use-attribute-sets="figure-style">
|
6102
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6152
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
6103
6153
|
</fo:block>
|
6104
6154
|
<xsl:call-template name="fn_display_figure"/>
|
6105
|
-
<xsl:for-each select="*[local-name() = 'note']">
|
6155
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
6106
6156
|
<xsl:call-template name="note"/>
|
6107
6157
|
</xsl:for-each>
|
6108
6158
|
|
@@ -6359,24 +6409,47 @@
|
|
6359
6409
|
|
6360
6410
|
</xsl:when>
|
6361
6411
|
<xsl:otherwise>
|
6362
|
-
|
6363
|
-
|
6364
|
-
|
6365
|
-
<xsl:
|
6366
|
-
|
6367
|
-
|
6368
|
-
<xsl:
|
6369
|
-
|
6370
|
-
|
6371
|
-
|
6372
|
-
|
6373
|
-
|
6374
|
-
|
6375
|
-
|
6376
|
-
|
6377
|
-
|
6378
|
-
|
6379
|
-
|
6412
|
+
|
6413
|
+
<xsl:variable name="element">
|
6414
|
+
<xsl:choose>
|
6415
|
+
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
6416
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
6417
|
+
</xsl:when>
|
6418
|
+
<xsl:otherwise>
|
6419
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
6420
|
+
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
6421
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
6422
|
+
</xsl:if>
|
6423
|
+
</fo:block>
|
6424
|
+
</xsl:otherwise>
|
6425
|
+
</xsl:choose>
|
6426
|
+
</xsl:variable>
|
6427
|
+
|
6428
|
+
<xsl:for-each select="xalan:nodeset($element)/*">
|
6429
|
+
<xsl:copy>
|
6430
|
+
<xsl:copy-of select="@*"/>
|
6431
|
+
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
6432
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
6433
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
6434
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
6435
|
+
</xsl:if>
|
6436
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
6437
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
6438
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
6439
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
6440
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
6441
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
6442
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
6443
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
6444
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
6445
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
6446
|
+
</xsl:if>
|
6447
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
6448
|
+
<xsl:copy-of select="$svg_content"/>
|
6449
|
+
</fo:instream-foreign-object>
|
6450
|
+
<!-- </fo:block> -->
|
6451
|
+
</xsl:copy>
|
6452
|
+
</xsl:for-each>
|
6380
6453
|
</xsl:otherwise>
|
6381
6454
|
</xsl:choose>
|
6382
6455
|
</xsl:template>
|
@@ -6468,6 +6541,13 @@
|
|
6468
6541
|
</xsl:for-each>
|
6469
6542
|
</xsl:template>
|
6470
6543
|
|
6544
|
+
<!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
|
6545
|
+
<xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
6546
|
+
<xsl:for-each select="*[local-name() = 'svg']">
|
6547
|
+
<xsl:call-template name="image_svg"/>
|
6548
|
+
</xsl:for-each>
|
6549
|
+
</xsl:template>
|
6550
|
+
|
6471
6551
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
6472
6552
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
6473
6553
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -6606,6 +6686,8 @@
|
|
6606
6686
|
<xsl:value-of select="."/>
|
6607
6687
|
</xsl:template>
|
6608
6688
|
|
6689
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
|
6690
|
+
|
6609
6691
|
<xsl:template match="node()" mode="contents">
|
6610
6692
|
<xsl:apply-templates mode="contents"/>
|
6611
6693
|
</xsl:template>
|
@@ -6913,7 +6995,15 @@
|
|
6913
6995
|
<xsl:value-of select="@section"/>
|
6914
6996
|
<xsl:text> </xsl:text>
|
6915
6997
|
</xsl:if>
|
6916
|
-
<xsl:
|
6998
|
+
<xsl:variable name="title">
|
6999
|
+
<xsl:for-each select="title/node()">
|
7000
|
+
<xsl:choose>
|
7001
|
+
<xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
|
7002
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
7003
|
+
</xsl:choose>
|
7004
|
+
</xsl:for-each>
|
7005
|
+
</xsl:variable>
|
7006
|
+
<xsl:value-of select="normalize-space($title)"/>
|
6917
7007
|
</fo:bookmark-title>
|
6918
7008
|
<xsl:apply-templates mode="bookmark"/>
|
6919
7009
|
</fo:bookmark>
|
@@ -6939,6 +7029,12 @@
|
|
6939
7029
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
|
6940
7030
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
|
6941
7031
|
|
7032
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
|
7033
|
+
<fo:block text-align="right" keep-with-next="always">
|
7034
|
+
<xsl:apply-templates/>
|
7035
|
+
</fo:block>
|
7036
|
+
</xsl:template>
|
7037
|
+
|
6942
7038
|
<!-- ====== -->
|
6943
7039
|
<!-- ====== -->
|
6944
7040
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
@@ -7088,6 +7184,10 @@
|
|
7088
7184
|
</xsl:for-each>
|
7089
7185
|
</xsl:template>
|
7090
7186
|
|
7187
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
|
7188
|
+
<xsl:value-of select="."/>
|
7189
|
+
</xsl:template>
|
7190
|
+
|
7091
7191
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
7092
7192
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
7093
7193
|
<xsl:apply-templates mode="contents_item"/>
|
@@ -357,6 +357,7 @@
|
|
357
357
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']"/>
|
358
358
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]"/>
|
359
359
|
|
360
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
360
361
|
</fo:block-container>
|
361
362
|
</fo:flow>
|
362
363
|
</fo:page-sequence>
|
@@ -373,6 +374,8 @@
|
|
373
374
|
<fo:flow flow-name="xsl-region-body">
|
374
375
|
<fo:block-container>
|
375
376
|
<xsl:apply-templates select="/*/*[local-name()='annex']"/>
|
377
|
+
|
378
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
376
379
|
</fo:block-container>
|
377
380
|
</fo:flow>
|
378
381
|
</fo:page-sequence>
|
@@ -390,6 +393,8 @@
|
|
390
393
|
<fo:block-container>
|
391
394
|
<!-- Bibliography -->
|
392
395
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
|
396
|
+
|
397
|
+
<xsl:if test="$table_if = 'true'"><fo:block/></xsl:if>
|
393
398
|
</fo:block-container>
|
394
399
|
</fo:flow>
|
395
400
|
</fo:page-sequence>
|
@@ -2639,7 +2644,7 @@
|
|
2639
2644
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
2640
2645
|
|
2641
2646
|
<xsl:choose>
|
2642
|
-
<xsl:when test="@width">
|
2647
|
+
<xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
|
2643
2648
|
|
2644
2649
|
<!-- centered table when table name is centered (see table-name-style) -->
|
2645
2650
|
|
@@ -2964,6 +2969,7 @@
|
|
2964
2969
|
This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
|
2965
2970
|
<xsl:when test="(@width_max > $page_width and @width_min < $page_width) or (@width_min >= $page_width)">
|
2966
2971
|
<!-- difference between the available space and the minimum table width -->
|
2972
|
+
<_width_min><xsl:value-of select="@width_min"/></_width_min>
|
2967
2973
|
<xsl:variable name="W" select="$page_width - @width_min"/>
|
2968
2974
|
<W><xsl:value-of select="$W"/></W>
|
2969
2975
|
<!-- difference between maximum and minimum width of the table -->
|
@@ -3581,17 +3587,20 @@
|
|
3581
3587
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
3582
3588
|
<xsl:variable name="reference" select="@reference"/>
|
3583
3589
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3584
|
-
<fo:block xsl:use-attribute-sets="table-fn-style">
|
3585
3590
|
|
3586
|
-
|
3591
|
+
<fo:block xsl:use-attribute-sets="table-fn-style">
|
3587
3592
|
|
3588
|
-
|
3593
|
+
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
|
3594
|
+
|
3595
|
+
<xsl:value-of select="@reference"/>
|
3596
|
+
|
3597
|
+
</fo:inline>
|
3598
|
+
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
3599
|
+
<xsl:copy-of select="./node()"/>
|
3600
|
+
</fo:inline>
|
3601
|
+
|
3602
|
+
</fo:block>
|
3589
3603
|
|
3590
|
-
</fo:inline>
|
3591
|
-
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
3592
|
-
<xsl:copy-of select="./node()"/>
|
3593
|
-
</fo:inline>
|
3594
|
-
</fo:block>
|
3595
3604
|
</xsl:if>
|
3596
3605
|
</xsl:for-each>
|
3597
3606
|
</xsl:template>
|
@@ -4534,12 +4543,12 @@
|
|
4534
4543
|
<xsl:param name="value"/>
|
4535
4544
|
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
4536
4545
|
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
4537
|
-
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-
|
4538
|
-
<xsl:attribute name="height">5mm</xsl:attribute>
|
4546
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
|
4547
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
|
4539
4548
|
<xsl:attribute name="content-width">100%</xsl:attribute>
|
4540
4549
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4541
4550
|
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4542
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4551
|
+
<!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4543
4552
|
<g>
|
4544
4553
|
<xsl:if test="$type = 'closing' or $type = 'end'">
|
4545
4554
|
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
@@ -4553,6 +4562,27 @@
|
|
4553
4562
|
</xsl:if>
|
4554
4563
|
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
4555
4564
|
</text>
|
4565
|
+
</svg> -->
|
4566
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4567
|
+
<g>
|
4568
|
+
<xsl:if test="$type = 'closing' or $type = 'end'">
|
4569
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
4570
|
+
</xsl:if>
|
4571
|
+
<polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
|
4572
|
+
<line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
|
4573
|
+
</g>
|
4574
|
+
<xsl:variable name="text_x">
|
4575
|
+
<xsl:choose>
|
4576
|
+
<xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
|
4577
|
+
<xsl:otherwise>22</xsl:otherwise>
|
4578
|
+
</xsl:choose>
|
4579
|
+
</xsl:variable>
|
4580
|
+
<text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
|
4581
|
+
<xsl:value-of select="$kind"/>
|
4582
|
+
</text>
|
4583
|
+
<text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
|
4584
|
+
<xsl:value-of select="$value"/>
|
4585
|
+
</text>
|
4556
4586
|
</svg>
|
4557
4587
|
</fo:instream-foreign-object>
|
4558
4588
|
</xsl:template>
|
@@ -4621,7 +4651,7 @@
|
|
4621
4651
|
</xsl:copy>
|
4622
4652
|
</xsl:template>
|
4623
4653
|
|
4624
|
-
<xsl:template match="*[local-name() = 'pagebreak']" mode="landscape_portrait">
|
4654
|
+
<xsl:template match="*[local-name() = 'pagebreak'][not(following-sibling::*[1][local-name() = 'pagebreak'])]" mode="landscape_portrait">
|
4625
4655
|
|
4626
4656
|
<!-- determine pagebreak is last element before </fo:flow> or not -->
|
4627
4657
|
<xsl:variable name="isLast">
|
@@ -4633,16 +4663,18 @@
|
|
4633
4663
|
<xsl:if test="contains($isLast, 'false')">
|
4634
4664
|
|
4635
4665
|
<xsl:variable name="orientation" select="normalize-space(@orientation)"/>
|
4636
|
-
|
4666
|
+
|
4667
|
+
<xsl:variable name="tree_">
|
4637
4668
|
<xsl:for-each select="ancestor::*[ancestor::fo:flow]">
|
4638
4669
|
<element pos="{position()}">
|
4639
4670
|
<xsl:value-of select="name()"/>
|
4640
4671
|
</element>
|
4641
4672
|
</xsl:for-each>
|
4642
4673
|
</xsl:variable>
|
4674
|
+
<xsl:variable name="tree" select="xalan:nodeset($tree_)"/>
|
4643
4675
|
|
4644
4676
|
<!-- close fo:page-sequence (closing preceding fo elements) -->
|
4645
|
-
<xsl:for-each select="
|
4677
|
+
<xsl:for-each select="$tree//element">
|
4646
4678
|
<xsl:sort data-type="number" order="descending" select="@pos"/>
|
4647
4679
|
<xsl:text disable-output-escaping="yes"></</xsl:text>
|
4648
4680
|
<xsl:value-of select="."/>
|
@@ -4653,7 +4685,6 @@
|
|
4653
4685
|
|
4654
4686
|
<!-- <pagebreak/> -->
|
4655
4687
|
<!-- create a new fo:page-sequence (opening fo elements) -->
|
4656
|
-
|
4657
4688
|
<xsl:text disable-output-escaping="yes"><fo:page-sequence master-reference="document</xsl:text><xsl:if test="$orientation != ''">-<xsl:value-of select="$orientation"/></xsl:if><xsl:text disable-output-escaping="yes">"></xsl:text>
|
4658
4689
|
<fo:static-content flow-name="xsl-footnote-separator">
|
4659
4690
|
<fo:block>
|
@@ -4663,7 +4694,7 @@
|
|
4663
4694
|
<xsl:call-template name="insertHeaderFooter"/>
|
4664
4695
|
<xsl:text disable-output-escaping="yes"><fo:flow flow-name="xsl-region-body"></xsl:text>
|
4665
4696
|
|
4666
|
-
<xsl:for-each select="
|
4697
|
+
<xsl:for-each select="$tree//element">
|
4667
4698
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
4668
4699
|
<xsl:value-of select="."/>
|
4669
4700
|
<xsl:for-each select="@*[local-name() != 'pos']">
|
@@ -4675,6 +4706,7 @@
|
|
4675
4706
|
</xsl:for-each>
|
4676
4707
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
4677
4708
|
</xsl:for-each>
|
4709
|
+
|
4678
4710
|
</xsl:if>
|
4679
4711
|
</xsl:template>
|
4680
4712
|
<!-- ================================================================ -->
|
@@ -4876,18 +4908,23 @@
|
|
4876
4908
|
|
4877
4909
|
<xsl:template name="add-zero-spaces-java">
|
4878
4910
|
<xsl:param name="text" select="."/>
|
4879
|
-
|
4880
|
-
|
4911
|
+
|
4912
|
+
<!-- add zero-width space (#x200B) after dot with next non-digit -->
|
4913
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1$2')"/>
|
4914
|
+
<!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
|
4915
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1')"/>
|
4916
|
+
<!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
|
4917
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1$2')"/>
|
4881
4918
|
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
4882
|
-
<xsl:variable name="
|
4919
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
4883
4920
|
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
4884
|
-
<xsl:variable name="
|
4921
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
4885
4922
|
<!-- add zero-width space (#x200B) before character: { -->
|
4886
|
-
<xsl:variable name="
|
4923
|
+
<xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
4887
4924
|
<!-- add zero-width space (#x200B) after character: , -->
|
4888
|
-
<xsl:variable name="
|
4925
|
+
<xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
4889
4926
|
|
4890
|
-
<xsl:value-of select="$
|
4927
|
+
<xsl:value-of select="$text7"/>
|
4891
4928
|
</xsl:template>
|
4892
4929
|
|
4893
4930
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -4896,7 +4933,9 @@
|
|
4896
4933
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
4897
4934
|
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
4898
4935
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4899
|
-
<xsl:
|
4936
|
+
<xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
4937
|
+
<!-- remove zero-width space at the end -->
|
4938
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '$', '')"/>
|
4900
4939
|
</xsl:template>
|
4901
4940
|
|
4902
4941
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -5033,7 +5072,7 @@
|
|
5033
5072
|
</xsl:copy>
|
5034
5073
|
</xsl:template>
|
5035
5074
|
|
5036
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
5075
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
|
5037
5076
|
<xsl:copy>
|
5038
5077
|
<xsl:copy-of select="@*"/>
|
5039
5078
|
<p>
|
@@ -5109,6 +5148,14 @@
|
|
5109
5148
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
|
5110
5149
|
</xsl:template>
|
5111
5150
|
|
5151
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
|
5152
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5153
|
+
</xsl:template>
|
5154
|
+
|
5155
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
|
5156
|
+
<xsl:apply-templates mode="table-without-br"/>
|
5157
|
+
</xsl:template>
|
5158
|
+
|
5112
5159
|
<!-- mode="table-without-br" -->
|
5113
5160
|
<!-- ================================== -->
|
5114
5161
|
<!-- END: Step 0. replace <br/> to <p>...</p> -->
|
@@ -5922,7 +5969,7 @@
|
|
5922
5969
|
|
5923
5970
|
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
|
5924
5971
|
|
5925
|
-
<fo:block-container margin-left="0mm">
|
5972
|
+
<fo:block-container margin-left="0mm" margin-right="0mm">
|
5926
5973
|
|
5927
5974
|
<fo:block>
|
5928
5975
|
|
@@ -6098,11 +6145,14 @@
|
|
6098
6145
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
6099
6146
|
</xsl:call-template>
|
6100
6147
|
|
6148
|
+
<!-- Example: Dimensions in millimeters -->
|
6149
|
+
<xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
|
6150
|
+
|
6101
6151
|
<fo:block xsl:use-attribute-sets="figure-style">
|
6102
|
-
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6152
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
|
6103
6153
|
</fo:block>
|
6104
6154
|
<xsl:call-template name="fn_display_figure"/>
|
6105
|
-
<xsl:for-each select="*[local-name() = 'note']">
|
6155
|
+
<xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
|
6106
6156
|
<xsl:call-template name="note"/>
|
6107
6157
|
</xsl:for-each>
|
6108
6158
|
|
@@ -6359,24 +6409,47 @@
|
|
6359
6409
|
|
6360
6410
|
</xsl:when>
|
6361
6411
|
<xsl:otherwise>
|
6362
|
-
|
6363
|
-
|
6364
|
-
|
6365
|
-
<xsl:
|
6366
|
-
|
6367
|
-
|
6368
|
-
<xsl:
|
6369
|
-
|
6370
|
-
|
6371
|
-
|
6372
|
-
|
6373
|
-
|
6374
|
-
|
6375
|
-
|
6376
|
-
|
6377
|
-
|
6378
|
-
|
6379
|
-
|
6412
|
+
|
6413
|
+
<xsl:variable name="element">
|
6414
|
+
<xsl:choose>
|
6415
|
+
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
6416
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
6417
|
+
</xsl:when>
|
6418
|
+
<xsl:otherwise>
|
6419
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
6420
|
+
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
6421
|
+
<xsl:attribute name="text-align">left</xsl:attribute>
|
6422
|
+
</xsl:if>
|
6423
|
+
</fo:block>
|
6424
|
+
</xsl:otherwise>
|
6425
|
+
</xsl:choose>
|
6426
|
+
</xsl:variable>
|
6427
|
+
|
6428
|
+
<xsl:for-each select="xalan:nodeset($element)/*">
|
6429
|
+
<xsl:copy>
|
6430
|
+
<xsl:copy-of select="@*"/>
|
6431
|
+
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
6432
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
6433
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
6434
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
6435
|
+
</xsl:if>
|
6436
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
6437
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
6438
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
6439
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
6440
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
6441
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
6442
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
6443
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
6444
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
6445
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
6446
|
+
</xsl:if>
|
6447
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
6448
|
+
<xsl:copy-of select="$svg_content"/>
|
6449
|
+
</fo:instream-foreign-object>
|
6450
|
+
<!-- </fo:block> -->
|
6451
|
+
</xsl:copy>
|
6452
|
+
</xsl:for-each>
|
6380
6453
|
</xsl:otherwise>
|
6381
6454
|
</xsl:choose>
|
6382
6455
|
</xsl:template>
|
@@ -6468,6 +6541,13 @@
|
|
6468
6541
|
</xsl:for-each>
|
6469
6542
|
</xsl:template>
|
6470
6543
|
|
6544
|
+
<!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
|
6545
|
+
<xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
|
6546
|
+
<xsl:for-each select="*[local-name() = 'svg']">
|
6547
|
+
<xsl:call-template name="image_svg"/>
|
6548
|
+
</xsl:for-each>
|
6549
|
+
</xsl:template>
|
6550
|
+
|
6471
6551
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
6472
6552
|
<xsl:variable name="svg_content" select="document(@src)"/>
|
6473
6553
|
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
@@ -6606,6 +6686,8 @@
|
|
6606
6686
|
<xsl:value-of select="."/>
|
6607
6687
|
</xsl:template>
|
6608
6688
|
|
6689
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
|
6690
|
+
|
6609
6691
|
<xsl:template match="node()" mode="contents">
|
6610
6692
|
<xsl:apply-templates mode="contents"/>
|
6611
6693
|
</xsl:template>
|
@@ -6913,7 +6995,15 @@
|
|
6913
6995
|
<xsl:value-of select="@section"/>
|
6914
6996
|
<xsl:text> </xsl:text>
|
6915
6997
|
</xsl:if>
|
6916
|
-
<xsl:
|
6998
|
+
<xsl:variable name="title">
|
6999
|
+
<xsl:for-each select="title/node()">
|
7000
|
+
<xsl:choose>
|
7001
|
+
<xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
|
7002
|
+
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
7003
|
+
</xsl:choose>
|
7004
|
+
</xsl:for-each>
|
7005
|
+
</xsl:variable>
|
7006
|
+
<xsl:value-of select="normalize-space($title)"/>
|
6917
7007
|
</fo:bookmark-title>
|
6918
7008
|
<xsl:apply-templates mode="bookmark"/>
|
6919
7009
|
</fo:bookmark>
|
@@ -6939,6 +7029,12 @@
|
|
6939
7029
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
|
6940
7030
|
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
|
6941
7031
|
|
7032
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
|
7033
|
+
<fo:block text-align="right" keep-with-next="always">
|
7034
|
+
<xsl:apply-templates/>
|
7035
|
+
</fo:block>
|
7036
|
+
</xsl:template>
|
7037
|
+
|
6942
7038
|
<!-- ====== -->
|
6943
7039
|
<!-- ====== -->
|
6944
7040
|
<xsl:template match="*[local-name() = 'title']" mode="contents_item">
|
@@ -7088,6 +7184,10 @@
|
|
7088
7184
|
</xsl:for-each>
|
7089
7185
|
</xsl:template>
|
7090
7186
|
|
7187
|
+
<xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
|
7188
|
+
<xsl:value-of select="."/>
|
7189
|
+
</xsl:template>
|
7190
|
+
|
7091
7191
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
7092
7192
|
<xsl:template match="*[local-name() = 'span']" mode="contents_item">
|
7093
7193
|
<xsl:apply-templates mode="contents_item"/>
|
@@ -10,11 +10,11 @@ module IsoDoc
|
|
10
10
|
::Relaton::Render::IHO::General.new(language: @lang)
|
11
11
|
end
|
12
12
|
|
13
|
-
def norm_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn)
|
13
|
+
def norm_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn, _bib)
|
14
14
|
"[#{ordinal}]<tab/>"
|
15
15
|
end
|
16
16
|
|
17
|
-
def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn)
|
17
|
+
def biblio_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn, _bib)
|
18
18
|
"[#{ordinal}]<tab/>"
|
19
19
|
end
|
20
20
|
|
@@ -216,6 +216,9 @@
|
|
216
216
|
<optional>
|
217
217
|
<ref name="fullname"/>
|
218
218
|
</optional>
|
219
|
+
<zeroOrMore>
|
220
|
+
<ref name="credential"/>
|
221
|
+
</zeroOrMore>
|
219
222
|
<zeroOrMore>
|
220
223
|
<ref name="affiliation"/>
|
221
224
|
</zeroOrMore>
|
@@ -232,6 +235,11 @@
|
|
232
235
|
<ref name="FullNameType"/>
|
233
236
|
</element>
|
234
237
|
</define>
|
238
|
+
<define name="credential">
|
239
|
+
<element name="credential">
|
240
|
+
<text/>
|
241
|
+
</element>
|
242
|
+
</define>
|
235
243
|
<define name="FullNameType">
|
236
244
|
<choice>
|
237
245
|
<group>
|
@@ -305,7 +313,9 @@
|
|
305
313
|
<zeroOrMore>
|
306
314
|
<ref name="affiliationdescription"/>
|
307
315
|
</zeroOrMore>
|
308
|
-
<
|
316
|
+
<optional>
|
317
|
+
<ref name="organization"/>
|
318
|
+
</optional>
|
309
319
|
</element>
|
310
320
|
</define>
|
311
321
|
<define name="affiliationname">
|
@@ -3,9 +3,6 @@ require "metanorma/generic/converter"
|
|
3
3
|
|
4
4
|
module Metanorma
|
5
5
|
module IHO
|
6
|
-
# A {Converter} implementation that generates RSD output, and a document
|
7
|
-
# schema encapsulation of the document for validation
|
8
|
-
#
|
9
6
|
class Converter < Metanorma::Generic::Converter
|
10
7
|
XML_ROOT_TAG = "iho-standard".freeze
|
11
8
|
XML_NAMESPACE = "https://www.metanorma.org/ns/iho".freeze
|
@@ -19,7 +16,7 @@ module Metanorma
|
|
19
16
|
end
|
20
17
|
|
21
18
|
def appendix_parse(attrs, xml, node)
|
22
|
-
attrs["inline-header"
|
19
|
+
attrs[:"inline-header"] = node.option? "inline-header"
|
23
20
|
set_obligation(attrs, node)
|
24
21
|
xml.appendix **attr_code(attrs) do |xml_section|
|
25
22
|
xml_section.title { |name| name << node.title }
|
@@ -37,7 +34,7 @@ module Metanorma
|
|
37
34
|
|
38
35
|
def metadata_series(node, xml)
|
39
36
|
series = node.attr("series") or return
|
40
|
-
xml.series
|
37
|
+
xml.series type: "main" do |s|
|
41
38
|
s.title SERIESNAME[series.to_sym] || "N/A"
|
42
39
|
s.abbreviation series
|
43
40
|
end
|
@@ -89,6 +86,16 @@ module Metanorma
|
|
89
86
|
end
|
90
87
|
end
|
91
88
|
|
89
|
+
def metadata_version(node, xml)
|
90
|
+
if node.attr("edition-major")
|
91
|
+
ed = node.attr("edition-major")
|
92
|
+
e1 = node.attr("edition-minor") and ed += ".#{e1}"
|
93
|
+
(e2 = node.attr("edition-patch")) && e1 and ed += ".#{e2}"
|
94
|
+
node.set_attribute("edition", ed)
|
95
|
+
end
|
96
|
+
super
|
97
|
+
end
|
98
|
+
|
92
99
|
def configuration
|
93
100
|
Metanorma::IHO.configuration
|
94
101
|
end
|
@@ -66,6 +66,7 @@
|
|
66
66
|
<value>caution</value>
|
67
67
|
<value>statement</value>
|
68
68
|
<value>editorial</value>
|
69
|
+
<value>box</value>
|
69
70
|
</choice>
|
70
71
|
</define>
|
71
72
|
<define name="index">
|
@@ -1577,6 +1578,9 @@
|
|
1577
1578
|
<zeroOrMore>
|
1578
1579
|
<ref name="indexsect"/>
|
1579
1580
|
</zeroOrMore>
|
1581
|
+
<optional>
|
1582
|
+
<ref name="colophon"/>
|
1583
|
+
</optional>
|
1580
1584
|
</element>
|
1581
1585
|
</define>
|
1582
1586
|
<define name="misccontainer">
|
@@ -1599,6 +1603,13 @@
|
|
1599
1603
|
</oneOrMore>
|
1600
1604
|
</element>
|
1601
1605
|
</define>
|
1606
|
+
<define name="colophon">
|
1607
|
+
<element name="colophon">
|
1608
|
+
<oneOrMore>
|
1609
|
+
<ref name="content"/>
|
1610
|
+
</oneOrMore>
|
1611
|
+
</element>
|
1612
|
+
</define>
|
1602
1613
|
<define name="foreword">
|
1603
1614
|
<element name="foreword">
|
1604
1615
|
<ref name="Content-Section"/>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|