metanorma-jis 0.4.5 → 0.5.0

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.
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:jis="https://www.metanorma.org/ns/jis" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" xmlns:jeuclid="http://jeuclid.sf.net/ns/ext" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java" extension-element-prefixes="redirect" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:jis="https://www.metanorma.org/ns/standoc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" xmlns:jeuclid="http://jeuclid.sf.net/ns/ext" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java" extension-element-prefixes="redirect" version="1.0">
2
2
 
3
3
  <xsl:output method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -19,14 +19,14 @@
19
19
  <xsl:variable name="numbers_japanese" select="xalan:nodeset($numbers_japanese_)"/>
20
20
 
21
21
  <xsl:variable name="contents_">
22
- <xsl:variable name="bundle" select="count(//jis:jis-standard) &gt; 1"/>
22
+ <xsl:variable name="bundle" select="count(//jis:metanorma) &gt; 1"/>
23
23
 
24
24
  <xsl:if test="normalize-space($bundle) = 'true'">
25
25
  <collection firstpage_id="firstpage_id_0"/>
26
26
  </xsl:if>
27
27
 
28
- <xsl:for-each select="//jis:jis-standard">
29
- <xsl:variable name="num"><xsl:number level="any" count="jis:jis-standard"/></xsl:variable>
28
+ <xsl:for-each select="//jis:metanorma">
29
+ <xsl:variable name="num"><xsl:number level="any" count="jis:metanorma"/></xsl:variable>
30
30
  <xsl:variable name="docnumber"><xsl:value-of select="jis:bibdata/jis:docidentifier[@type = 'JIS']"/></xsl:variable>
31
31
  <xsl:variable name="current_document">
32
32
  <xsl:copy-of select="."/>
@@ -471,8 +471,8 @@
471
471
  <xsl:variable name="updated_xml_step2" select="xalan:nodeset($updated_xml_step2_)"/>
472
472
  <!-- DEBUG: updated_xml_step2=<xsl:copy-of select="$updated_xml_step2"/> -->
473
473
 
474
- <xsl:for-each select="$updated_xml_step2//jis:jis-standard">
475
- <xsl:variable name="num"><xsl:number level="any" count="jis:jis-standard"/></xsl:variable>
474
+ <xsl:for-each select="$updated_xml_step2//jis:metanorma">
475
+ <xsl:variable name="num"><xsl:number level="any" count="jis:metanorma"/></xsl:variable>
476
476
 
477
477
  <xsl:variable name="current_document">
478
478
  <xsl:copy-of select="."/>
@@ -532,7 +532,7 @@
532
532
  <xsl:otherwise><xsl:value-of select="$docidentifier_JIS_"/></xsl:otherwise>
533
533
  </xsl:choose>
534
534
  </xsl:variable>
535
- <xsl:variable name="edition" select="/jis:jis-standard/jis:bibdata/jis:edition[@language = 'ja' and @numberonly = 'true']"/>
535
+ <xsl:variable name="edition" select="/jis:metanorma/jis:bibdata/jis:edition[@language = 'ja' and @numberonly = 'true']"/>
536
536
 
537
537
  <xsl:variable name="doclang">
538
538
  <xsl:call-template name="getLang"/>
@@ -575,7 +575,7 @@
575
575
  <!-- ========================== -->
576
576
 
577
577
  <xsl:variable name="bibdata">
578
- <xsl:copy-of select="/jis:jis-standard/jis:bibdata"/>
578
+ <xsl:copy-of select="/jis:metanorma/jis:bibdata"/>
579
579
  </xsl:variable>
580
580
 
581
581
  <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'clause' and @type = 'contributors')]">
@@ -789,7 +789,7 @@
789
789
  <!-- page break before each section -->
790
790
  <xsl:variable name="structured_xml">
791
791
  <xsl:for-each select="xalan:nodeset($structured_xml_)/item[*]">
792
- <xsl:element name="pagebreak" namespace="https://www.metanorma.org/ns/jis"/>
792
+ <xsl:element name="pagebreak" namespace="{$namespace_full}"/>
793
793
  <xsl:copy-of select="./*"/>
794
794
  </xsl:for-each>
795
795
  </xsl:variable>
@@ -991,7 +991,7 @@
991
991
 
992
992
  </xsl:for-each>
993
993
 
994
- <xsl:if test="not(//jis:jis-standard)">
994
+ <xsl:if test="not(//jis:metanorma)">
995
995
  <fo:page-sequence master-reference="document" force-page-count="no-force">
996
996
  <fo:flow flow-name="xsl-region-body">
997
997
  <fo:block><!-- prevent fop error for empty document --></fo:block>
@@ -1305,14 +1305,14 @@
1305
1305
 
1306
1306
  <fo:page-sequence master-reference="cover-page_2024" force-page-count="no-force">
1307
1307
 
1308
- <!-- <xsl:variable name="cover_page_background_1_value" select="normalize-space(//jis:jis-standard/jis:metanorma-extension/jis:presentation-metadata/jis:color-cover-page-background-1)"/>
1308
+ <!-- <xsl:variable name="cover_page_background_1_value" select="normalize-space(//jis:metanorma/jis:metanorma-extension/jis:presentation-metadata/jis:color-cover-page-background-1)"/>
1309
1309
  <xsl:variable name="cover_page_background_1_">
1310
1310
  <xsl:value-of select="$cover_page_background_1_value"/>
1311
1311
  <xsl:if test="$cover_page_background_1_value = ''">#00063F</xsl:if>
1312
1312
  </xsl:variable>
1313
1313
  <xsl:variable name="cover_page_background_1" select="normalize-space($cover_page_background_1_)"/>
1314
1314
 
1315
- <xsl:variable name="cover_page_background_2_value" select="normalize-space(//jis:jis-standard/jis:metanorma-extension/jis:presentation-metadata/jis:color-cover-page-background-2)"/>
1315
+ <xsl:variable name="cover_page_background_2_value" select="normalize-space(//jis:metanorma/jis:metanorma-extension/jis:presentation-metadata/jis:color-cover-page-background-2)"/>
1316
1316
  <xsl:variable name="cover_page_background_2_">
1317
1317
  <xsl:value-of select="$cover_page_background_2_value"/>
1318
1318
  <xsl:if test="$cover_page_background_2_value = ''">#DBD6BD</xsl:if>
@@ -1369,20 +1369,20 @@
1369
1369
  <fo:table-body>
1370
1370
  <fo:table-row height="50mm">
1371
1371
  <fo:table-cell>
1372
- <fo:block><xsl:value-of select="$publisher"/></fo:block>
1372
+ <fo:block id="__internal_layout__coverpage_footer_block1_{$num}_{generate-id()}"><xsl:value-of select="$publisher"/></fo:block>
1373
1373
  </fo:table-cell>
1374
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1374
+ <fo:table-cell><fo:block id="__internal_layout__coverpage_footer_block2_{$num}_{generate-id()}"> </fo:block></fo:table-cell>
1375
1375
  <fo:table-cell>
1376
- <fo:block><xsl:value-of select="$authorizer"/></fo:block>
1376
+ <fo:block id="__internal_layout__coverpage_footer_block3_{$num}_{generate-id()}"><xsl:value-of select="$authorizer"/></fo:block>
1377
1377
  </fo:table-cell>
1378
1378
  </fo:table-row>
1379
1379
  <fo:table-row>
1380
1380
  <fo:table-cell>
1381
- <fo:block><xsl:if test="normalize-space($publisher) != ''">発行</xsl:if></fo:block>
1381
+ <fo:block id="__internal_layout__coverpage_footer_block4_{$num}_{generate-id()}"><xsl:if test="normalize-space($publisher) != ''">発行</xsl:if></fo:block>
1382
1382
  </fo:table-cell>
1383
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
1383
+ <fo:table-cell><fo:block id="__internal_layout__coverpage_footer_block5_{$num}_{generate-id()}"> </fo:block></fo:table-cell>
1384
1384
  <fo:table-cell>
1385
- <fo:block><xsl:if test="normalize-space($authorizer) != ''">審議</xsl:if></fo:block>
1385
+ <fo:block id="__internal_layout__coverpage_footer_block6_{$num}_{generate-id()}"><xsl:if test="normalize-space($authorizer) != ''">審議</xsl:if></fo:block>
1386
1386
  </fo:table-cell>
1387
1387
  </fo:table-row>
1388
1388
  </fo:table-body>
@@ -1433,7 +1433,7 @@
1433
1433
  </xsl:for-each>
1434
1434
  </xsl:variable>
1435
1435
  <xsl:attribute name="width"><xsl:value-of select="sum(xalan:nodeset($blocksWidth)//width)"/>em</xsl:attribute>
1436
- <fo:block-container width="1em">
1436
+ <fo:block-container width="1em" id="__internal_layout__coverpage_block1_{$num}_{generate-id()}">
1437
1437
  <xsl:copy-of select="$blocks"/>
1438
1438
  </fo:block-container>
1439
1439
  </fo:inline-container>
@@ -1441,7 +1441,7 @@
1441
1441
  <fo:inline font-size="8.16pt" baseline-shift="20%">:</fo:inline>
1442
1442
 
1443
1443
  <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
1444
- <fo:block-container width="1em">
1444
+ <fo:block-container width="1em" id="__internal_layout__coverpage_block2_{$num}_{generate-id()}">
1445
1445
  <fo:block line-height="1em" margin-top="0.2em"/>
1446
1446
  <fo:block font-size="8.16pt" baseline-shift="20%">
1447
1447
  <xsl:call-template name="insertEachCharInBlock">
@@ -1488,7 +1488,7 @@
1488
1488
  <fo:static-content flow-name="header">
1489
1489
  <xsl:variable name="presentation_metadata_image_name">
1490
1490
  <xsl:choose>
1491
- <xsl:when test="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'backpage-image']/*[local-name() = 'value']/*[local-name() = 'image']">backpage-image</xsl:when>
1491
+ <xsl:when test="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'backpage-image']/*[local-name() = 'value']/*[local-name() = 'image']">backpage-image</xsl:when>
1492
1492
  <xsl:otherwise>coverpage-image</xsl:otherwise>
1493
1493
  </xsl:choose>
1494
1494
  </xsl:variable>
@@ -2616,7 +2616,7 @@
2616
2616
  <xsl:param name="structured_xml"/>
2617
2617
  <xsl:choose>
2618
2618
  <xsl:when test="not(xalan:nodeset($structured_xml)/*[local-name()='pagebreak'])">
2619
- <xsl:element name="page" namespace="https://www.metanorma.org/ns/jis">
2619
+ <xsl:element name="page" namespace="{$namespace_full}">
2620
2620
  <xsl:copy-of select="xalan:nodeset($structured_xml)"/>
2621
2621
  </xsl:element>
2622
2622
  </xsl:when>
@@ -2626,7 +2626,7 @@
2626
2626
  <xsl:variable name="pagebreak_id" select="generate-id()"/>
2627
2627
 
2628
2628
  <!-- copy elements before pagebreak -->
2629
- <xsl:element name="page" namespace="https://www.metanorma.org/ns/jis">
2629
+ <xsl:element name="page" namespace="{$namespace_full}">
2630
2630
  <xsl:if test="not(preceding-sibling::jis:pagebreak)">
2631
2631
  <xsl:copy-of select="../@*"/>
2632
2632
  </xsl:if>
@@ -2638,7 +2638,7 @@
2638
2638
 
2639
2639
  <!-- copy elements after last page break -->
2640
2640
  <xsl:if test="position() = last() and following-sibling::node()">
2641
- <xsl:element name="page" namespace="https://www.metanorma.org/ns/jis">
2641
+ <xsl:element name="page" namespace="{$namespace_full}">
2642
2642
  <xsl:copy-of select="@orientation"/>
2643
2643
  <xsl:copy-of select="following-sibling::node()"/>
2644
2644
  </xsl:element>
@@ -2845,7 +2845,7 @@
2845
2845
  <!-- jis:term/jis:preferred2//text() | -->
2846
2846
 
2847
2847
  <!-- <name>注記 1</name> to <name>注記<font_en> 1</font_en></name> -->
2848
- <xsl:template match="jis:title/text() | jis:term/jis:name/text() | jis:note/jis:name/text() | jis:termnote/jis:name/text() | jis:table/jis:name/text() | jis:figure/jis:name/text() | jis:termexample/jis:name/text() | jis:xref//text() | jis:origin/text()" mode="update_xml_step1">
2848
+ <xsl:template match="jis:title/text() | jis:fmt-title/text() | jis:term/jis:name/text() | jis:term/jis:fmt-name/text() | jis:note/jis:name/text() | jis:note/jis:fmt-name/text() | jis:termnote/jis:name/text() |jis:termnote/jis:fmt-name/text() | jis:table/jis:name/text() |jis:table/jis:fmt-name/text() | jis:figure/jis:name/text() |jis:figure/jis:fmt-name/text() | jis:termexample/jis:name/text() |jis:termexample/jis:fmtname/text() | jis:xref//text() | jis:fmt-xref//text() | jis:origin/text() | jis:fmt-origin/text()" mode="update_xml_step1">
2849
2849
  <xsl:choose>
2850
2850
  <xsl:when test="$vertical_layout = 'true'">
2851
2851
  <xsl:choose>
@@ -2889,30 +2889,52 @@
2889
2889
  </xsl:template>
2890
2890
 
2891
2891
  <!-- move example title to the first paragraph -->
2892
- <xsl:template match="jis:example[contains(jis:name/text(), ' — ')]" mode="update_xml_step1">
2892
+ <!-- Example:
2893
+ <example id="_7569d639-c245-acb6-2141-3b746374a9e1" autonum="1">
2894
+ <name id="_8eac959b-b129-4892-b8bb-fcca2914bd39">(可能性の例)</name>
2895
+ <fmt-name>
2896
+ <span class="fmt-caption-label">
2897
+ <span class="fmt-element-name">例</span>
2898
+ <semx element="autonum" source="_7569d639-c245-acb6-2141-3b746374a9e1">1</semx>
2899
+ </span>
2900
+ <span class="fmt-caption-delim"> — </span>
2901
+ <semx element="name" source="_8eac959b-b129-4892-b8bb-fcca2914bd39">(可能性の例)</semx>
2902
+ </fmt-name>
2903
+ -->
2904
+ <!-- <xsl:template match="jis:example[contains(normalize-space(jis:fmt-name), ' — ')]" mode="update_xml_step1"> -->
2905
+ <xsl:template match="jis:example[jis:fmt-name[contains(jis:span/text(), ' — ')]]" mode="update_xml_step1">
2893
2906
  <xsl:copy>
2894
2907
  <xsl:copy-of select="@*"/>
2895
- <xsl:element name="p" namespace="https://www.metanorma.org/ns/jis">
2896
- <xsl:value-of select="substring-after(jis:name/text()[1], ' — ')"/>
2897
- <xsl:apply-templates select="jis:name/text()[1]/following-sibling::node()" mode="update_xml_step1"/>
2908
+ <xsl:element name="p" namespace="{$namespace_full}">
2909
+ <!-- <xsl:variable name="example_name">
2910
+ <xsl:apply-templates select="jis:fmt-name" mode="update_xml_step1"/>
2911
+ </xsl:variable>
2912
+ <xsl:value-of select="substring-after(xalan:nodeset($example_name)/jis:name/text()[1], ' — ')"/>
2913
+ <xsl:apply-templates select="xalan:nodeset($example_name)/jis:name/text()[1]/following-sibling::node()" mode="update_xml_step1"/> -->
2914
+ <xsl:apply-templates select="jis:fmt-name/jis:span[contains(., ' — ')][1]/following-sibling::node()" mode="update_xml_step1"/>
2898
2915
  </xsl:element>
2899
2916
  <xsl:apply-templates mode="update_xml_step1"/>
2900
2917
  </xsl:copy>
2901
2918
  </xsl:template>
2902
- <xsl:template match="jis:example/jis:name[contains(text(), ' — ')]" mode="update_xml_step1">
2903
- <xsl:copy>
2919
+ <!-- <xsl:template match="jis:example/jis:fmt-name[contains(normalize-space(), ' — ')]" mode="update_xml_step1"> -->
2920
+ <xsl:template match="jis:example/jis:fmt-name[contains(jis:span/text(), ' — ')]" mode="update_xml_step1" priority="2">
2921
+ <xsl:element name="name" namespace="{$namespace_full}">
2904
2922
  <xsl:copy-of select="@*"/>
2905
- <xsl:apply-templates select="text()[1]" mode="update_xml_step1"/>
2906
- </xsl:copy>
2923
+ <!-- <xsl:variable name="example_name">
2924
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
2925
+ </xsl:variable>
2926
+ <xsl:apply-templates select="xalan:nodeset($example_name)//text()[1]" mode="update_xml_step1"/>
2927
+ -->
2928
+ <xsl:apply-templates select="*[1]" mode="update_xml_step1"/>
2929
+ </xsl:element>
2907
2930
  </xsl:template>
2908
- <xsl:template match="jis:example/jis:name/text()" mode="update_xml_step1">
2909
- <xsl:variable name="example_name">
2910
- <xsl:choose>
2931
+ <xsl:template match="jis:example/jis:fmt-name//text()" mode="update_xml_step1">
2932
+ <xsl:variable name="example_name" select="."/>
2933
+ <!-- <xsl:choose>
2911
2934
  <xsl:when test="contains(., ' — ')"><xsl:value-of select="substring-before(., ' — ')"/></xsl:when>
2912
2935
  <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2913
2936
  </xsl:choose>
2914
- </xsl:variable>
2915
-
2937
+ </xsl:variable> -->
2916
2938
  <xsl:choose>
2917
2939
  <xsl:when test="$vertical_layout = 'true'">
2918
2940
  <xsl:call-template name="enclose_text_in_vertical_tag">
@@ -2927,7 +2949,7 @@
2927
2949
  </xsl:choose>
2928
2950
  </xsl:template>
2929
2951
 
2930
- <xsl:template match="jis:eref//text()" mode="update_xml_step1">
2952
+ <xsl:template match="jis:fmt-eref//text()" mode="update_xml_step1">
2931
2953
  <xsl:choose>
2932
2954
  <xsl:when test="$vertical_layout = 'true'">
2933
2955
  <xsl:call-template name="enclose_text_in_vertical_tag"/>
@@ -2968,7 +2990,6 @@
2968
2990
  <xsl:apply-templates mode="update_xml_step1"/>
2969
2991
  </xsl:template>
2970
2992
  <xsl:template match="jis:strong/text()" priority="2" mode="update_xml_step1">
2971
-
2972
2993
  <xsl:choose>
2973
2994
  <xsl:when test="$vertical_layout = 'true'">
2974
2995
  <xsl:call-template name="enclose_text_in_vertical_tag"/>
@@ -3024,7 +3045,12 @@
3024
3045
 
3025
3046
  <!-- bold English text in non-vertical layout -->
3026
3047
  <xsl:template match="*[local-name() = 'font_en_bold'][normalize-space() != '']">
3027
- <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
3048
+ <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
3049
+ <xsl:choose>
3050
+ <xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
3051
+ <xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
3052
+ </xsl:choose>
3053
+ </xsl:if>
3028
3054
  <fo:inline>
3029
3055
  <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
3030
3056
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -3033,12 +3059,22 @@
3033
3059
  </xsl:if>
3034
3060
  <xsl:apply-templates/>
3035
3061
  </fo:inline>
3036
- <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
3062
+ <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
3063
+ <xsl:choose>
3064
+ <xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
3065
+ <xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
3066
+ </xsl:choose>
3067
+ </xsl:if>
3037
3068
  </xsl:template>
3038
3069
 
3039
3070
  <!-- English text in non-vertical layout -->
3040
3071
  <xsl:template match="*[local-name() = 'font_en'][normalize-space() != '']">
3041
- <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
3072
+ <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
3073
+ <xsl:choose>
3074
+ <xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
3075
+ <xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
3076
+ </xsl:choose>
3077
+ </xsl:if>
3042
3078
  <fo:inline>
3043
3079
  <xsl:if test="not(ancestor::jis:p[@class = 'zzSTDTitle2']) and not(ancestor::jis:span[@class = 'JIS'])">
3044
3080
  <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
@@ -3048,7 +3084,12 @@
3048
3084
  </xsl:if>
3049
3085
  <xsl:apply-templates/>
3050
3086
  </fo:inline>
3051
- <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']"><xsl:value-of select="$zero_width_space"/></xsl:if>
3087
+ <xsl:if test="ancestor::*[local-name() = 'td' or local-name() = 'th']">
3088
+ <xsl:choose>
3089
+ <xsl:when test="$isGenerateTableIF = 'false'"><fo:inline font-size="0.1pt"><xsl:text> </xsl:text></fo:inline></xsl:when>
3090
+ <xsl:otherwise><fo:inline><xsl:value-of select="$zero_width_space"/></fo:inline></xsl:otherwise>
3091
+ </xsl:choose>
3092
+ </xsl:if>
3052
3093
  </xsl:template>
3053
3094
 
3054
3095
  <!-- English text in vertical layout -->
@@ -3329,7 +3370,7 @@
3329
3370
  <fo:static-content flow-name="header-last" role="artifact">
3330
3371
  <fo:block font-size="12pt" font-weight="bold" margin-left="10mm">
3331
3372
  <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
3332
- <fo:block-container width="1em">
3373
+ <fo:block-container width="1em" id="__internal_layout__lastpage_{generate-id()}">
3333
3374
  <xsl:call-template name="insertEachCharInBlock">
3334
3375
  <xsl:with-param name="str">JIS <xsl:value-of select="$docidentifier_number"/></xsl:with-param>
3335
3376
  <xsl:with-param name="spaceIndent">0.5em</xsl:with-param>
@@ -3382,7 +3423,10 @@
3382
3423
  <fo:static-content flow-name="left-region"> <!-- role="artifact" commented, because there is <fo:retrieve-marker below, occurs java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 -->
3383
3424
  <fo:block-container absolute-position="fixed" left="0mm" top="0" width="6mm" height="{$pageHeightA5}mm" background-color="{$cover_header_footer_background}">
3384
3425
  <fo:block-container font-size="9pt" color="white" text-align="center">
3385
- <fo:block margin-top="131mm">
3426
+ <xsl:if test="$isGenerateTableIF = 'false'">
3427
+ <xsl:attribute name="writing-mode">tb-rl</xsl:attribute>
3428
+ </xsl:if>
3429
+ <fo:block margin-top="131mm" margin-right="1mm">
3386
3430
  <fo:page-number/>
3387
3431
  </fo:block> <!-- 二 -->
3388
3432
  </fo:block-container>
@@ -5516,21 +5560,21 @@
5516
5560
 
5517
5561
  <xsl:variable name="namespace_full_">
5518
5562
  <xsl:choose>
5519
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
5520
- <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
5563
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
5564
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
5521
5565
  </xsl:choose>
5522
5566
  </xsl:variable>
5523
5567
  <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
5524
5568
 
5525
5569
  <xsl:variable name="root_element_">
5526
5570
  <xsl:choose>
5527
- <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
5528
- <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
5571
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
5572
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
5529
5573
  </xsl:choose>
5530
5574
  </xsl:variable>
5531
5575
  <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
5532
5576
 
5533
- <xsl:variable name="document_scheme" select="normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
5577
+ <xsl:variable name="document_scheme" select="normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
5534
5578
 
5535
5579
  <!-- external parameters -->
5536
5580
 
@@ -5631,7 +5675,7 @@
5631
5675
  </metanorma-extension>
5632
5676
  -->
5633
5677
 
5634
- <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
5678
+ <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
5635
5679
  <xsl:variable name="papersize_width_">
5636
5680
  <xsl:choose>
5637
5681
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -5713,7 +5757,7 @@
5713
5757
  <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
5714
5758
 
5715
5759
  <xsl:variable name="layout_columns_default">1</xsl:variable>
5716
- <xsl:variable name="layout_columns_" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
5760
+ <xsl:variable name="layout_columns_" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
5717
5761
  <xsl:variable name="layout_columns">
5718
5762
  <xsl:choose>
5719
5763
  <xsl:when test="$layout_columns_ != ''"><xsl:value-of select="$layout_columns_"/></xsl:when>
@@ -5774,7 +5818,7 @@
5774
5818
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
5775
5819
 
5776
5820
  <xsl:variable name="title-list-tables">
5777
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
5821
+ <xsl:variable name="toc_table_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
5778
5822
  <xsl:value-of select="$toc_table_title"/>
5779
5823
  <xsl:if test="normalize-space($toc_table_title) = ''">
5780
5824
  <xsl:call-template name="getLocalizedString">
@@ -5784,7 +5828,7 @@
5784
5828
  </xsl:variable>
5785
5829
 
5786
5830
  <xsl:variable name="title-list-figures">
5787
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
5831
+ <xsl:variable name="toc_figure_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
5788
5832
  <xsl:value-of select="$toc_figure_title"/>
5789
5833
  <xsl:if test="normalize-space($toc_figure_title) = ''">
5790
5834
  <xsl:call-template name="getLocalizedString">
@@ -5794,7 +5838,7 @@
5794
5838
  </xsl:variable>
5795
5839
 
5796
5840
  <xsl:variable name="title-list-recommendations">
5797
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
5841
+ <xsl:variable name="toc_requirement_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
5798
5842
  <xsl:value-of select="$toc_requirement_title"/>
5799
5843
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
5800
5844
  <xsl:call-template name="getLocalizedString">
@@ -5804,8 +5848,8 @@
5804
5848
  </xsl:variable>
5805
5849
 
5806
5850
  <xsl:variable name="bibdata">
5807
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
5808
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
5851
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']"/>
5852
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'localized-strings']"/>
5809
5853
  </xsl:variable>
5810
5854
 
5811
5855
  <!-- Characters -->
@@ -5870,7 +5914,7 @@
5870
5914
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
5871
5915
 
5872
5916
  <xsl:variable name="additional_fonts_">
5873
- <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
5917
+ <xsl:for-each select="//*[local-name() = 'metanorma'][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[local-name() = 'metanorma'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
5874
5918
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
5875
5919
  </xsl:for-each>
5876
5920
  </xsl:variable>
@@ -7292,10 +7336,10 @@
7292
7336
 
7293
7337
  <xsl:template name="processTablesFigures_Contents">
7294
7338
  <xsl:param name="always"/>
7295
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
7339
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
7296
7340
  <xsl:call-template name="processTables_Contents"/>
7297
7341
  </xsl:if>
7298
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
7342
+ <xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
7299
7343
  <xsl:call-template name="processFigures_Contents"/>
7300
7344
  </xsl:if>
7301
7345
  </xsl:template>
@@ -7375,7 +7419,7 @@
7375
7419
  </xsl:template><!-- END: processMainSectionsDefault -->
7376
7420
 
7377
7421
  <!-- Example:
7378
- <iso-standard>
7422
+ <metanorma>
7379
7423
  <preface>
7380
7424
  <page_sequence>
7381
7425
  <clause...
@@ -7398,7 +7442,7 @@
7398
7442
  <page_sequence>
7399
7443
  <annex ..
7400
7444
  </page_sequence>
7401
- </iso-standard>
7445
+ </metanorma>
7402
7446
  -->
7403
7447
  <xsl:template name="processPrefaceAndMainSectionsDefault_items">
7404
7448
 
@@ -7441,15 +7485,8 @@
7441
7485
  </xsl:template> <!-- END: insertPrefaceSectionsPageSequences -->
7442
7486
 
7443
7487
  <xsl:template name="insertMainSectionsPageSequences">
7444
- <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
7445
- <xsl:element name="page_sequence" namespace="{$namespace_full}">
7446
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
7447
- <xsl:sort select="@displayorder" data-type="number"/>
7448
- <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
7449
7488
 
7450
- </xsl:for-each>
7451
- </xsl:element>
7452
- </xsl:element>
7489
+ <xsl:call-template name="insertSectionsInPageSequence"/>
7453
7490
 
7454
7491
  <xsl:element name="page_sequence" namespace="{$namespace_full}">
7455
7492
  <xsl:for-each select="/*/*[local-name()='annex']">
@@ -7468,6 +7505,18 @@
7468
7505
  </xsl:element>
7469
7506
  </xsl:template> <!-- END: insertMainSectionsPageSequences -->
7470
7507
 
7508
+ <xsl:template name="insertSectionsInPageSequence">
7509
+ <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
7510
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
7511
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
7512
+ <xsl:sort select="@displayorder" data-type="number"/>
7513
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
7514
+
7515
+ </xsl:for-each>
7516
+ </xsl:element>
7517
+ </xsl:element>
7518
+ </xsl:template>
7519
+
7471
7520
  <xsl:template name="insertMainSectionsInSeparatePageSequences">
7472
7521
  <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
7473
7522
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
@@ -8979,7 +9028,7 @@
8979
9028
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
8980
9029
 
8981
9030
  <xsl:variable name="gen_id" select="generate-id(.)"/>
8982
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9031
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
8983
9032
  <xsl:variable name="reference_">
8984
9033
  <xsl:value-of select="@reference"/>
8985
9034
  <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
@@ -9165,13 +9214,13 @@
9165
9214
  footnotes in bibliography
9166
9215
  footnotes in document's body (except table's head/body/foot and figure text)
9167
9216
  -->
9168
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
9217
+ <xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
9169
9218
  <fn gen_id="{generate-id(.)}">
9170
9219
  <xsl:copy-of select="@*"/>
9171
9220
  <xsl:copy-of select="node()"/>
9172
9221
  </fn>
9173
9222
  </xsl:for-each>
9174
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]//*[local-name()='bibliography']/*">
9223
+ <xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name()='boilerplate']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='preface']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='sections']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='annex'] | ancestor::*[local-name() = 'metanorma']//*[local-name()='bibliography']/*">
9175
9224
  <xsl:sort select="@displayorder" data-type="number"/>
9176
9225
  <!-- commented:
9177
9226
  .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
@@ -10945,9 +10994,14 @@
10945
10994
 
10946
10995
  <xsl:variable name="simple-table">
10947
10996
 
10997
+ <xsl:variable name="table_without_semantic_elements">
10998
+ <xsl:apply-templates mode="update_xml_pres"/>
10999
+ </xsl:variable>
11000
+
10948
11001
  <!-- Step 0. replace <br/> to <p>...</p> -->
10949
11002
  <xsl:variable name="table_without_br">
10950
- <xsl:apply-templates mode="table-without-br"/>
11003
+ <!-- <xsl:apply-templates mode="table-without-br"/> -->
11004
+ <xsl:apply-templates select="xalan:nodeset($table_without_semantic_elements)" mode="table-without-br"/>
10951
11005
  </xsl:variable>
10952
11006
 
10953
11007
  <!-- Step 1. colspan processing -->
@@ -11563,6 +11617,8 @@
11563
11617
  <!-- ======================================= -->
11564
11618
  <!-- math -->
11565
11619
  <!-- ======================================= -->
11620
+ <xsl:template match="*[local-name() = 'stem'][following-sibling::*[1][local-name() = 'fmt-stem']]"/> <!-- for tablesonly.xml generated by mn2pdf -->
11621
+
11566
11622
  <xsl:template match="mathml:math">
11567
11623
  <xsl:variable name="isAdded" select="@added"/>
11568
11624
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -11922,10 +11978,10 @@
11922
11978
  <xsl:template match="*[local-name()='localityStack']"/>
11923
11979
 
11924
11980
  <xsl:variable name="pdfAttachmentsList_">
11925
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11981
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11926
11982
  <attachment filename="{@name}"/>
11927
11983
  </xsl:for-each>
11928
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
11984
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
11929
11985
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
11930
11986
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
11931
11987
  <attachment filename="{$attachment_path}"/>
@@ -13410,7 +13466,9 @@
13410
13466
  <xsl:apply-templates mode="bookmarks"/>
13411
13467
  </xsl:template>
13412
13468
 
13413
- <xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
13469
+ <xsl:template match="*[local-name() = 'stem']" mode="contents"/>
13470
+
13471
+ <xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'fmt-stem']" mode="contents">
13414
13472
  <xsl:apply-templates select="."/>
13415
13473
  </xsl:template>
13416
13474
 
@@ -13427,7 +13485,15 @@
13427
13485
  <xsl:apply-templates mode="contents"/>
13428
13486
  </xsl:template>
13429
13487
 
13430
- <xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
13488
+ <xsl:template match="*[local-name() = 'concept']" mode="contents"/>
13489
+ <xsl:template match="*[local-name() = 'eref']" mode="contents"/>
13490
+ <xsl:template match="*[local-name() = 'xref']" mode="contents"/>
13491
+ <xsl:template match="*[local-name() = 'link']" mode="contents"/>
13492
+ <xsl:template match="*[local-name() = 'origin']" mode="contents"/>
13493
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
13494
+
13495
+ <xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
13496
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
13431
13497
  <xsl:apply-templates mode="bookmarks"/>
13432
13498
  </xsl:template>
13433
13499
 
@@ -13440,6 +13506,13 @@
13440
13506
  <xsl:apply-templates mode="bookmarks"/>
13441
13507
  </xsl:template>
13442
13508
 
13509
+ <xsl:template match="*[local-name() = 'concept']" mode="bookmarks"/>
13510
+ <xsl:template match="*[local-name() = 'eref']" mode="bookmarks"/>
13511
+ <xsl:template match="*[local-name() = 'xref']" mode="bookmarks"/>
13512
+ <xsl:template match="*[local-name() = 'link']" mode="bookmarks"/>
13513
+ <xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
13514
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
13515
+
13443
13516
  <!-- Bookmarks -->
13444
13517
  <xsl:template name="addBookmarks">
13445
13518
  <xsl:param name="contents"/>
@@ -13724,6 +13797,13 @@
13724
13797
 
13725
13798
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
13726
13799
 
13800
+ <xsl:template match="*[local-name() = 'concept']" mode="contents_item"/>
13801
+ <xsl:template match="*[local-name() = 'eref']" mode="contents_item"/>
13802
+ <xsl:template match="*[local-name() = 'xref']" mode="contents_item"/>
13803
+ <xsl:template match="*[local-name() = 'link']" mode="contents_item"/>
13804
+ <xsl:template match="*[local-name() = 'origin']" mode="contents_item"/>
13805
+ <xsl:template match="*[local-name() = 'erefstack ']" mode="contents_item"/>
13806
+
13727
13807
  <xsl:template name="getSection">
13728
13808
  <xsl:choose>
13729
13809
  <xsl:when test="*[local-name() = 'fmt-title']">
@@ -13843,7 +13923,8 @@
13843
13923
  </xsl:copy>
13844
13924
  </xsl:template>
13845
13925
 
13846
- <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
13926
+ <xsl:template match="*[local-name() = 'stem']" mode="contents_item"/>
13927
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="contents_item">
13847
13928
  <xsl:copy-of select="."/>
13848
13929
  </xsl:template>
13849
13930
 
@@ -13907,7 +13988,7 @@
13907
13988
  <!-- sourcecode -->
13908
13989
  <!-- =============== -->
13909
13990
 
13910
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
13991
+ <xsl:variable name="source-highlighter-css_" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
13911
13992
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
13912
13993
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
13913
13994
 
@@ -15326,7 +15407,7 @@
15326
15407
 
15327
15408
  </xsl:template> <!-- sections_element_style -->
15328
15409
 
15329
- <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
15410
+ <xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
15330
15411
 
15331
15412
  <fo:block break-after="page"/>
15332
15413
 
@@ -15430,7 +15511,7 @@
15430
15511
  <fo:block id="{@id}" font-size="1pt" role="SKIP"><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>
15431
15512
  </xsl:when>
15432
15513
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
15433
- <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
15514
+ <xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
15434
15515
  <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
15435
15516
  </xsl:when>
15436
15517
  <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
@@ -16811,7 +16892,7 @@
16811
16892
  <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
16812
16893
 
16813
16894
  <!-- move section 'Normative references' inside 'sections' -->
16814
- <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
16895
+ <xsl:for-each select="* | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
16815
16896
  <xsl:sort select="@displayorder" data-type="number"/>
16816
16897
 
16817
16898
  <!-- process Section's title -->
@@ -16872,10 +16953,126 @@
16872
16953
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
16873
16954
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
16874
16955
 
16875
- <xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
16956
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
16957
+ <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
16958
+
16959
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
16960
+ <xsl:element name="stem" namespace="{$namespace_full}">
16961
+ <xsl:copy-of select="@*"/>
16962
+ <xsl:choose>
16963
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
16964
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
16965
+ </xsl:when>
16966
+ <xsl:otherwise>
16967
+ <xsl:copy-of select="node()"/>
16968
+ </xsl:otherwise>
16969
+ </xsl:choose>
16970
+ </xsl:element>
16971
+ </xsl:template>
16972
+ <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
16973
+ <xsl:element name="stem" namespace="{$namespace_full}">
16974
+ <xsl:copy-of select="@*"/>
16975
+ <xsl:choose>
16976
+ <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
16977
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
16978
+ </xsl:when>
16979
+ <xsl:otherwise>
16980
+ <xsl:copy-of select="node()"/>
16981
+ </xsl:otherwise>
16982
+ </xsl:choose>
16983
+ </xsl:element>
16984
+ </xsl:template>
16985
+
16986
+ <xsl:template match="*[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
16876
16987
  <xsl:copy-of select="."/>
16877
16988
  </xsl:template>
16878
16989
 
16990
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
16991
+ <!-- *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] -->
16992
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_step1">
16993
+ <xsl:copy>
16994
+ <xsl:copy-of select="@*"/>
16995
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
16996
+ <xsl:choose>
16997
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
16998
+ <xsl:choose>
16999
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
17000
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
17001
+ </xsl:when>
17002
+ <xsl:otherwise>
17003
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_step1"/>
17004
+ </xsl:otherwise>
17005
+ </xsl:choose>
17006
+ </xsl:when>
17007
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
17008
+ <xsl:choose>
17009
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
17010
+ <xsl:copy-of select="node()"/>
17011
+ </xsl:when>
17012
+ <xsl:otherwise>
17013
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_step1"/>
17014
+ </xsl:otherwise>
17015
+ </xsl:choose>
17016
+ </xsl:otherwise>
17017
+ </xsl:choose>
17018
+ </xsl:copy>
17019
+ </xsl:template>
17020
+ <xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_pres">
17021
+ <xsl:copy>
17022
+ <xsl:copy-of select="@*"/>
17023
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
17024
+ <xsl:choose>
17025
+ <xsl:when test="*[local-name() = 'fmt-sourcecode']">
17026
+ <xsl:choose>
17027
+ <xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
17028
+ <xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
17029
+ </xsl:when>
17030
+ <xsl:otherwise>
17031
+ <xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_pres"/>
17032
+ </xsl:otherwise>
17033
+ </xsl:choose>
17034
+ </xsl:when>
17035
+ <xsl:otherwise> <!-- If fmt-sourcecode is not present -->
17036
+ <xsl:choose>
17037
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
17038
+ <xsl:copy-of select="node()"/>
17039
+ </xsl:when>
17040
+ <xsl:otherwise>
17041
+ <xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_pres"/>
17042
+ </xsl:otherwise>
17043
+ </xsl:choose>
17044
+ </xsl:otherwise>
17045
+ </xsl:choose>
17046
+ </xsl:copy>
17047
+ </xsl:template>
17048
+
17049
+ <!-- https://github.com/metanorma/isodoc/issues/651 -->
17050
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_step1" priority="2">
17051
+ <xsl:copy>
17052
+ <xsl:copy-of select="@*"/>
17053
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
17054
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_step1"/>
17055
+ </xsl:copy>
17056
+ </xsl:template>
17057
+ <xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_pres" priority="2">
17058
+ <xsl:copy>
17059
+ <xsl:copy-of select="@*"/>
17060
+ <xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
17061
+ <xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_pres"/>
17062
+ </xsl:copy>
17063
+ </xsl:template>
17064
+
17065
+ <!-- https://github.com/metanorma/isodoc/issues/652 -->
17066
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']"/>
17067
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']"/>
17068
+ <xsl:template match="*[local-name() = 'amend']"/>
17069
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_step1"/>
17070
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_step1"/>
17071
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_pres"/>
17072
+ <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
17073
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
17074
+ <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
17075
+
16879
17076
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
16880
17077
  <xsl:copy>
16881
17078
  <xsl:copy-of select="@*"/>
@@ -16906,7 +17103,7 @@
16906
17103
  <!-- add @id - first element with @id plus '_element_name' -->
16907
17104
  <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
16908
17105
  <xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
16909
- <xsl:variable name="document_suffix" select="ancestor::*[contains(local-name(), '-standard')]/@document_suffix"/>
17106
+ <xsl:variable name="document_suffix" select="ancestor::*[local-name() = 'metanorma']/@document_suffix"/>
16910
17107
  <xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
16911
17108
  </xsl:if>
16912
17109
  </xsl:template>
@@ -17021,16 +17218,30 @@
17021
17218
 
17022
17219
  <xsl:template match="*[local-name() = 'fmt-name']"/>
17023
17220
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
17024
- <xsl:element name="name" namespace="{$namespace_full}">
17025
- <xsl:copy-of select="@*"/>
17026
- <xsl:apply-templates mode="update_xml_step1"/>
17027
- </xsl:element>
17221
+ <xsl:choose>
17222
+ <xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
17223
+ <xsl:apply-templates mode="update_xml_step1"/>
17224
+ </xsl:when>
17225
+ <xsl:otherwise>
17226
+ <xsl:element name="name" namespace="{$namespace_full}">
17227
+ <xsl:copy-of select="@*"/>
17228
+ <xsl:apply-templates mode="update_xml_step1"/>
17229
+ </xsl:element>
17230
+ </xsl:otherwise>
17231
+ </xsl:choose>
17028
17232
  </xsl:template>
17029
17233
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_pres">
17030
- <xsl:element name="name" namespace="{$namespace_full}">
17031
- <xsl:copy-of select="@*"/>
17032
- <xsl:apply-templates mode="update_xml_pres"/>
17033
- </xsl:element>
17234
+ <xsl:choose>
17235
+ <xsl:when test="local-name(..) = 'p' and ancestor::*[local-name() = 'table']">
17236
+ <xsl:apply-templates mode="update_xml_step1"/>
17237
+ </xsl:when>
17238
+ <xsl:otherwise>
17239
+ <xsl:element name="name" namespace="{$namespace_full}">
17240
+ <xsl:copy-of select="@*"/>
17241
+ <xsl:apply-templates mode="update_xml_pres"/>
17242
+ </xsl:element>
17243
+ </xsl:otherwise>
17244
+ </xsl:choose>
17034
17245
  </xsl:template>
17035
17246
 
17036
17247
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
@@ -17128,6 +17339,9 @@
17128
17339
  <xsl:apply-templates mode="update_xml_pres"/>
17129
17340
  </xsl:template>
17130
17341
 
17342
+ <xsl:template match="*[local-name() = 'semx']">
17343
+ <xsl:apply-templates/>
17344
+ </xsl:template>
17131
17345
  <xsl:template match="*[local-name() = 'semx']" mode="update_xml_step1">
17132
17346
  <xsl:apply-templates mode="update_xml_step1"/>
17133
17347
  </xsl:template>
@@ -17139,6 +17353,126 @@
17139
17353
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
17140
17354
  <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
17141
17355
 
17356
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_step1">
17357
+ <xsl:apply-templates mode="update_xml_step1"/>
17358
+ </xsl:template>
17359
+
17360
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_pres">
17361
+ <xsl:apply-templates mode="update_xml_pres"/>
17362
+ </xsl:template>
17363
+
17364
+ <xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_step1"/>
17365
+
17366
+ <xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_pres"/>
17367
+
17368
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_step1">
17369
+ <xsl:apply-templates mode="update_xml_step1"/>
17370
+ </xsl:template>
17371
+ <xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_pres">
17372
+ <xsl:apply-templates mode="update_xml_pres"/>
17373
+ </xsl:template>
17374
+
17375
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_step1"/>
17376
+ <xsl:template match="*[local-name() = 'identifier']" mode="update_xml_pres"/>
17377
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_step1">
17378
+ <xsl:element name="identifier" namespace="{$namespace_full}">
17379
+ <xsl:copy-of select="@*"/>
17380
+ <xsl:apply-templates mode="update_xml_step1"/>
17381
+ </xsl:element>
17382
+ </xsl:template>
17383
+ <xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_pres">
17384
+ <xsl:element name="identifier" namespace="{$namespace_full}">
17385
+ <xsl:copy-of select="@*"/>
17386
+ <xsl:apply-templates mode="update_xml_pres"/>
17387
+ </xsl:element>
17388
+ </xsl:template>
17389
+
17390
+ <xsl:template match="*[local-name() = 'concept']"/>
17391
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_step1"/>
17392
+ <xsl:template match="*[local-name() = 'concept']" mode="update_xml_pres"/>
17393
+
17394
+ <xsl:template match="*[local-name() = 'fmt-concept']">
17395
+ <xsl:apply-templates/>
17396
+ </xsl:template>
17397
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_step1">
17398
+ <xsl:apply-templates mode="update_xml_step1"/>
17399
+ </xsl:template>
17400
+ <xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_pres">
17401
+ <xsl:apply-templates mode="update_xml_pres"/>
17402
+ </xsl:template>
17403
+
17404
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_step1"/>
17405
+ <xsl:template match="*[local-name() = 'eref']" mode="update_xml_pres"/>
17406
+
17407
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_step1">
17408
+ <xsl:element name="eref" namespace="{$namespace_full}">
17409
+ <xsl:copy-of select="@*"/>
17410
+ <xsl:apply-templates mode="update_xml_step1"/>
17411
+ </xsl:element>
17412
+ </xsl:template>
17413
+ <xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_pres">
17414
+ <xsl:element name="eref" namespace="{$namespace_full}">
17415
+ <xsl:copy-of select="@*"/>
17416
+ <xsl:apply-templates mode="update_xml_pres"/>
17417
+ </xsl:element>
17418
+ </xsl:template>
17419
+
17420
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_step1"/>
17421
+ <xsl:template match="*[local-name() = 'xref']" mode="update_xml_pres"/>
17422
+
17423
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_step1">
17424
+ <xsl:element name="xref" namespace="{$namespace_full}">
17425
+ <xsl:copy-of select="@*"/>
17426
+ <xsl:apply-templates mode="update_xml_step1"/>
17427
+ </xsl:element>
17428
+ </xsl:template>
17429
+ <xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_pres">
17430
+ <xsl:element name="xref" namespace="{$namespace_full}">
17431
+ <xsl:copy-of select="@*"/>
17432
+ <xsl:apply-templates mode="update_xml_pres"/>
17433
+ </xsl:element>
17434
+ </xsl:template>
17435
+
17436
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_step1"/>
17437
+ <xsl:template match="*[local-name() = 'link']" mode="update_xml_pres"/>
17438
+
17439
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_step1">
17440
+ <xsl:element name="link" namespace="{$namespace_full}">
17441
+ <xsl:copy-of select="@*"/>
17442
+ <xsl:apply-templates mode="update_xml_step1"/>
17443
+ </xsl:element>
17444
+ </xsl:template>
17445
+ <xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_pres">
17446
+ <xsl:element name="link" namespace="{$namespace_full}">
17447
+ <xsl:copy-of select="@*"/>
17448
+ <xsl:apply-templates mode="update_xml_pres"/>
17449
+ </xsl:element>
17450
+ </xsl:template>
17451
+
17452
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_step1"/>
17453
+ <xsl:template match="*[local-name() = 'origin']" mode="update_xml_pres"/>
17454
+
17455
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_step1">
17456
+ <xsl:element name="origin" namespace="{$namespace_full}">
17457
+ <xsl:copy-of select="@*"/>
17458
+ <xsl:apply-templates mode="update_xml_step1"/>
17459
+ </xsl:element>
17460
+ </xsl:template>
17461
+ <xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_pres">
17462
+ <xsl:element name="origin" namespace="{$namespace_full}">
17463
+ <xsl:copy-of select="@*"/>
17464
+ <xsl:apply-templates mode="update_xml_pres"/>
17465
+ </xsl:element>
17466
+ </xsl:template>
17467
+
17468
+ <xsl:template match="*[local-name() = 'erefstack']"/>
17469
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_step1"/>
17470
+ <xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_pres"/>
17471
+
17472
+ <xsl:template match="*[local-name() = 'svgmap']"/>
17473
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
17474
+ <xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
17475
+
17142
17476
  <!-- END: update new Presentation XML -->
17143
17477
 
17144
17478
  <!-- =========================================================================== -->
@@ -17211,7 +17545,7 @@
17211
17545
 
17212
17546
  <xsl:choose>
17213
17547
  <xsl:when test="$page_sequence_at_top = 'true'">
17214
- <xsl:for-each select="ancestor::*[ancestor::*[contains(local-name(), '-standard')]]">
17548
+ <xsl:for-each select="ancestor::*[ancestor::*[local-name() = 'metanorma']]">
17215
17549
  <element pos="{position()}">
17216
17550
  <xsl:copy-of select="@*[local-name() != 'id']"/>
17217
17551
  <xsl:value-of select="name()"/>
@@ -17743,7 +18077,7 @@
17743
18077
  </xsl:when>
17744
18078
  <xsl:when test="contains($text, $replace)">
17745
18079
  <xsl:value-of select="substring-before($text,$replace)"/>
17746
- <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/jis"><xsl:value-of select="$by"/></xsl:element>
18080
+ <xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/standoc"><xsl:value-of select="$by"/></xsl:element>
17747
18081
  <xsl:call-template name="replaceChar">
17748
18082
  <xsl:with-param name="text" select="substring-after($text,$replace)"/>
17749
18083
  <xsl:with-param name="replace" select="$replace"/>
@@ -17780,7 +18114,7 @@
17780
18114
  </xsl:variable>
17781
18115
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
17782
18116
  <xsl:variable name="gen_id" select="generate-id(.)"/>
17783
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
18117
+ <xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
17784
18118
  <xsl:variable name="reference" select="@reference"/>
17785
18119
  <!-- fn sequence number in document -->
17786
18120
  <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
@@ -17828,7 +18162,7 @@
17828
18162
  </xsl:template>
17829
18163
 
17830
18164
  <xsl:template name="printEdition">
17831
- <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
18165
+ <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
17832
18166
 
17833
18167
  <xsl:choose>
17834
18168
  <xsl:when test="$edition_i18n != ''">
@@ -17838,7 +18172,7 @@
17838
18172
  </xsl:call-template>
17839
18173
  </xsl:when>
17840
18174
  <xsl:otherwise>
17841
- <xsl:variable name="edition" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
18175
+ <xsl:variable name="edition" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
17842
18176
  <xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
17843
18177
  <xsl:call-template name="capitalize">
17844
18178
  <xsl:with-param name="str">
@@ -17972,7 +18306,7 @@
17972
18306
  <xsl:param name="charDelim" select="', '"/>
17973
18307
  <xsl:choose>
17974
18308
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
17975
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
18309
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
17976
18310
  <xsl:sort data-type="text" order="ascending"/>
17977
18311
  <xsl:call-template name="insertKeyword">
17978
18312
  <xsl:with-param name="meta" select="$meta"/>
@@ -17982,7 +18316,7 @@
17982
18316
  </xsl:for-each>
17983
18317
  </xsl:when>
17984
18318
  <xsl:otherwise>
17985
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
18319
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
17986
18320
  <xsl:call-template name="insertKeyword">
17987
18321
  <xsl:with-param name="meta" select="$meta"/>
17988
18322
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -18057,7 +18391,7 @@
18057
18391
  <!-- Dublin Core properties go here -->
18058
18392
  <dc:title>
18059
18393
  <xsl:variable name="title">
18060
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
18394
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
18061
18395
 
18062
18396
  <xsl:choose>
18063
18397
  <xsl:when test="*[local-name() = 'title'][@language = $lang and @type = 'main']">
@@ -18084,7 +18418,7 @@
18084
18418
  </rdf:Alt>
18085
18419
  </dc:title>
18086
18420
  <xsl:variable name="dc_creator">
18087
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
18421
+ <xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
18088
18422
 
18089
18423
  <rdf:Seq>
18090
18424
  <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
@@ -18106,7 +18440,7 @@
18106
18440
  <xsl:variable name="dc_description">
18107
18441
  <xsl:variable name="abstract">
18108
18442
 
18109
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
18443
+ <xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
18110
18444
 
18111
18445
  </xsl:variable>
18112
18446
  <rdf:Alt>
@@ -18134,7 +18468,7 @@
18134
18468
  </rdf:RDF>
18135
18469
  </x:xmpmeta>
18136
18470
  <!-- add attachments -->
18137
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
18471
+ <xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
18138
18472
  <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
18139
18473
  <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
18140
18474
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
@@ -18168,7 +18502,7 @@
18168
18502
  </pdf:embedded-file>
18169
18503
  </xsl:for-each>
18170
18504
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
18171
- <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
18505
+ <xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
18172
18506
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
18173
18507
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
18174
18508
  <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
@@ -18370,9 +18704,9 @@
18370
18704
  <xsl:variable name="XSLNS">
18371
18705
 
18372
18706
  </xsl:variable>
18373
- <xsl:if test="$documentNS != $XSLNS">
18707
+ <!-- <xsl:if test="$documentNS != $XSLNS">
18374
18708
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
18375
- </xsl:if>
18709
+ </xsl:if> -->
18376
18710
  </xsl:template> <!-- namespaceCheck -->
18377
18711
 
18378
18712
  <xsl:template name="getLanguage">
@@ -18451,10 +18785,10 @@
18451
18785
 
18452
18786
  <xsl:variable name="data_value">
18453
18787
  <xsl:choose>
18454
- <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
18788
+ <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != 0">
18455
18789
  <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18456
18790
  </xsl:when>
18457
- <xsl:when test="string-length($bibdata_updated) != ''">
18791
+ <xsl:when test="string-length($bibdata_updated) != 0">
18458
18792
  <xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
18459
18793
  </xsl:when>
18460
18794
  <xsl:when test="$formatted = 'true'">
@@ -18592,7 +18926,7 @@
18592
18926
  <!-- background image -->
18593
18927
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
18594
18928
  <fo:block>
18595
- <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
18929
+ <xsl:for-each select="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
18596
18930
  <xsl:choose>
18597
18931
  <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
18598
18932
  <fo:instream-foreign-object fox:alt-text="Image Front">