metanorma-csa 2.4.5 → 2.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be3ee9afaaeac7e5116f05cf4ea372cb97eeb0701478a76418b772131d4efa13
4
- data.tar.gz: 5e04ecaed0de6c94536dfcb65f38d4491f6bab75f9bce71b25f875a4b0b93bfc
3
+ metadata.gz: 410fe4d2cacf854422d4ec3cbb2ecaba07a5610e067331c8d1404fc56ff45e7d
4
+ data.tar.gz: 5de627e3d6fc556051da210306f56640c25b589773745a13ae6263436d6eea92
5
5
  SHA512:
6
- metadata.gz: 2b9d95ffafdd38135ca1a4f3f46e1e5566a51b7df35c291a141300a72019d625cf1bb0139977ed62cce09c470b5c0ae8b40574fd6d4677aa84b901430690e98c
7
- data.tar.gz: cea6b9bfcb8c4894f4635bc858f11ea39dea15fda4ff5af4c175324405564ba06e2f9cb3c99731dedecbce2f1abbcfd37e74779e11c7c324c73fd8c898380f61
6
+ metadata.gz: f988293e230023eebc9e033efb906f8f83297dcf7a3e8b0eb787c0c1322f7b3f01fc511c43fc32df74a899592e1cc31ebd2aa4203a9c88da23163b9d2700f9be
7
+ data.tar.gz: e5c83280fb17a84e50f27153590f995466f262b6abd10767aed13a28f8e669d5faa261047758a63ac5d18e1711652812d973495532a00a584f8b2d7b1ec91aa5
@@ -590,17 +590,30 @@
590
590
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
591
591
 
592
592
  <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
593
- <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
593
+ <xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
594
594
  <!-- Example: <tables>
595
- <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
596
- <tbody>
597
- <tr>
598
- <td id="tab-symdu_1_1">
599
- <p_len>6</p_len>
600
- <p_len>100</p_len> for 2nd paragraph
601
- <word_len>6</word_len>
602
- <word_len>20</word_len>
603
- ...
595
+ <table page-width="509103" id="table1" width_max="223561" width_min="223560">
596
+ <column width_max="39354" width_min="39354"/>
597
+ <column width_max="75394" width_min="75394"/>
598
+ <column width_max="108813" width_min="108813"/>
599
+ <tbody>
600
+ <tr>
601
+ <td width_max="39354" width_min="39354">
602
+ <p_len>39354</p_len>
603
+ <word_len>39354</word_len>
604
+ </td>
605
+
606
+ OLD:
607
+ <tables>
608
+ <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
609
+ <tbody>
610
+ <tr>
611
+ <td id="tab-symdu_1_1">
612
+ <p_len>6</p_len>
613
+ <p_len>100</p_len> for 2nd paragraph
614
+ <word_len>6</word_len>
615
+ <word_len>20</word_len>
616
+ ...
604
617
  -->
605
618
 
606
619
  <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
@@ -820,6 +833,9 @@
820
833
  <xsl:variable name="hair_space"> </xsl:variable>
821
834
  <xsl:variable name="en_dash">–</xsl:variable>
822
835
  <xsl:variable name="em_dash">—</xsl:variable>
836
+ <xsl:variable name="cr">&#13;</xsl:variable>
837
+ <xsl:variable name="lf">
838
+ </xsl:variable>
823
839
 
824
840
  <xsl:template name="getTitle">
825
841
  <xsl:param name="name"/>
@@ -2456,6 +2472,20 @@
2456
2472
  </xsl:for-each>
2457
2473
  </xsl:template>
2458
2474
 
2475
+ <xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
2476
+
2477
+ <xsl:template match="*[local-name()='table']" priority="2">
2478
+ <xsl:choose>
2479
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
2480
+ <xsl:call-template name="table"/>
2481
+ </xsl:when>
2482
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
2483
+ <xsl:otherwise>
2484
+ <xsl:call-template name="table"/>
2485
+ </xsl:otherwise>
2486
+ </xsl:choose>
2487
+ </xsl:template>
2488
+
2459
2489
  <xsl:template match="*[local-name()='table']" name="table">
2460
2490
 
2461
2491
  <xsl:variable name="table-preamble">
@@ -2465,9 +2495,11 @@
2465
2495
  <xsl:variable name="table">
2466
2496
 
2467
2497
  <xsl:variable name="simple-table">
2468
- <xsl:call-template name="getSimpleTable">
2469
- <xsl:with-param name="id" select="@id"/>
2470
- </xsl:call-template>
2498
+ <xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
2499
+ <xsl:call-template name="getSimpleTable">
2500
+ <xsl:with-param name="id" select="@id"/>
2501
+ </xsl:call-template>
2502
+ </xsl:if>
2471
2503
  </xsl:variable>
2472
2504
  <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2473
2505
 
@@ -2561,9 +2593,9 @@
2561
2593
  </xsl:attribute>
2562
2594
  </xsl:for-each>
2563
2595
 
2564
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2596
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2565
2597
  <xsl:if test="$isNoteOrFnExist = 'true'">
2566
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2598
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
2567
2599
  </xsl:if>
2568
2600
 
2569
2601
  <xsl:choose>
@@ -2716,9 +2748,28 @@
2716
2748
 
2717
2749
  </fo:block>
2718
2750
 
2751
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
2752
+ <xsl:if test="$continued = 'true'">
2753
+ <fo:block text-align="right">
2754
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
2755
+ </fo:block>
2756
+ </xsl:if>
2757
+ <!-- </xsl:if> -->
2758
+
2719
2759
  </xsl:if>
2720
2760
  </xsl:template> <!-- table/name -->
2721
2761
 
2762
+ <!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
2763
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
2764
+ <xsl:choose>
2765
+ <xsl:when test="preceding-sibling::*[local-name() = 'br']">
2766
+ <!-- remove CR or LF at start -->
2767
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^(&#13;&#10;|&#13;|&#10;)', '')"/>
2768
+ </xsl:when>
2769
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2770
+ </xsl:choose>
2771
+ </xsl:template>
2772
+
2722
2773
  <!-- SOURCE: ... -->
2723
2774
  <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
2724
2775
  <xsl:call-template name="termsource"/>
@@ -3129,7 +3180,7 @@
3129
3180
  <xsl:param name="colwidths"/>
3130
3181
  <xsl:param name="colgroup"/>
3131
3182
 
3132
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3183
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3133
3184
 
3134
3185
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3135
3186
 
@@ -3201,7 +3252,7 @@
3201
3252
 
3202
3253
  <xsl:apply-templates select="../*[local-name()='p']"/>
3203
3254
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3204
- <xsl:apply-templates select="../*[local-name()='note']"/>
3255
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
3205
3256
  <xsl:apply-templates select="../*[local-name()='example']"/>
3206
3257
  <xsl:apply-templates select="../*[local-name()='source']"/>
3207
3258
 
@@ -3211,7 +3262,7 @@
3211
3262
 
3212
3263
  <!-- horizontal row separator -->
3213
3264
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
3214
- <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3265
+ <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
3215
3266
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
3216
3267
 
3217
3268
  <xsl:call-template name="setBordersTableArray"/>
@@ -3876,7 +3927,20 @@
3876
3927
  <!-- Definition List -->
3877
3928
  <!-- ===================== -->
3878
3929
 
3879
- <xsl:template match="*[local-name()='dl']">
3930
+ <!-- for table auto-layout algorithm -->
3931
+ <xsl:template match="*[local-name()='dl']" priority="2">
3932
+ <xsl:choose>
3933
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
3934
+ <xsl:call-template name="dl"/>
3935
+ </xsl:when>
3936
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
3937
+ <xsl:otherwise>
3938
+ <xsl:call-template name="dl"/>
3939
+ </xsl:otherwise>
3940
+ </xsl:choose>
3941
+ </xsl:template>
3942
+
3943
+ <xsl:template match="*[local-name()='dl']" name="dl">
3880
3944
  <xsl:variable name="isAdded" select="@added"/>
3881
3945
  <xsl:variable name="isDeleted" select="@deleted"/>
3882
3946
  <!-- <dl><xsl:copy-of select="."/></dl> -->
@@ -5807,7 +5871,13 @@
5807
5871
  <xsl:value-of select="$language_current_2"/>
5808
5872
  </xsl:when>
5809
5873
  <xsl:otherwise>
5810
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
5874
+ <xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
5875
+ <xsl:choose>
5876
+ <xsl:when test="$language_current_3 != ''">
5877
+ <xsl:value-of select="$language_current_3"/>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>en</xsl:otherwise>
5880
+ </xsl:choose>
5811
5881
  </xsl:otherwise>
5812
5882
  </xsl:choose>
5813
5883
  </xsl:otherwise>
@@ -6673,10 +6743,11 @@
6673
6743
  </xsl:template>
6674
6744
 
6675
6745
  <xsl:template match="*[local-name() = 'image']">
6746
+ <xsl:param name="indent">0</xsl:param>
6676
6747
  <xsl:variable name="isAdded" select="../@added"/>
6677
6748
  <xsl:variable name="isDeleted" select="../@deleted"/>
6678
6749
  <xsl:choose>
6679
- <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6750
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']"> <!-- inline image ( 'image:path' in adoc, with one colon after image) -->
6680
6751
  <fo:inline padding-left="1mm" padding-right="1mm">
6681
6752
  <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
6682
6753
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -6685,7 +6756,43 @@
6685
6756
  <xsl:variable name="src">
6686
6757
  <xsl:call-template name="image_src"/>
6687
6758
  </xsl:variable>
6688
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
6759
+
6760
+ <xsl:variable name="scale">
6761
+ <xsl:call-template name="getImageScale">
6762
+ <xsl:with-param name="indent" select="$indent"/>
6763
+ </xsl:call-template>
6764
+ </xsl:variable>
6765
+
6766
+ <!-- debug scale='<xsl:value-of select="$scale"/>', indent='<xsl:value-of select="$indent"/>' -->
6767
+
6768
+ <!-- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> -->
6769
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle">
6770
+
6771
+ <xsl:variable name="width">
6772
+ <xsl:call-template name="setImageWidth"/>
6773
+ </xsl:variable>
6774
+ <xsl:if test="$width != ''">
6775
+ <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
6776
+ </xsl:if>
6777
+ <xsl:variable name="height">
6778
+ <xsl:call-template name="setImageHeight"/>
6779
+ </xsl:variable>
6780
+ <xsl:if test="$height != ''">
6781
+ <xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
6782
+ </xsl:if>
6783
+
6784
+ <xsl:if test="$width = '' and $height = ''">
6785
+ <xsl:if test="number($scale) &lt; 100">
6786
+ <xsl:attribute name="content-width"><xsl:value-of select="number($scale)"/>%</xsl:attribute>
6787
+ <!-- <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
6788
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6789
+ <xsl:attribute name="width">100%</xsl:attribute>
6790
+ <xsl:attribute name="scaling">uniform</xsl:attribute> -->
6791
+ </xsl:if>
6792
+ </xsl:if>
6793
+
6794
+ </fo:external-graphic>
6795
+
6689
6796
  </fo:inline>
6690
6797
  </xsl:when>
6691
6798
  <xsl:otherwise>
@@ -6706,25 +6813,23 @@
6706
6813
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6707
6814
  <xsl:attribute name="scaling">uniform</xsl:attribute>
6708
6815
 
6709
- <xsl:apply-templates select="." mode="cross_image"/>
6816
+ <xsl:apply-templates select="." mode="cross_image"/>
6710
6817
 
6711
6818
  </fo:instream-foreign-object>
6712
6819
  </xsl:when>
6713
6820
  <xsl:otherwise>
6821
+ <!-- <fo:block>debug block image:
6822
+ <xsl:variable name="scale">
6823
+ <xsl:call-template name="getImageScale">
6824
+ <xsl:with-param name="indent" select="$indent"/>
6825
+ </xsl:call-template>
6826
+ </xsl:variable>
6827
+ <xsl:value-of select="concat('scale=', $scale,', indent=', $indent)"/>
6828
+ </fo:block> -->
6714
6829
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
6715
- <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
6716
-
6717
- <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6718
- <xsl:attribute name="width">
6719
- <xsl:value-of select="@width"/>
6720
- </xsl:attribute>
6721
- </xsl:if>
6830
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
6722
6831
 
6723
- <xsl:if test="@height != '' and @height != 'auto'">
6724
- <xsl:attribute name="height">
6725
- <xsl:value-of select="@height"/>
6726
- </xsl:attribute>
6727
- </xsl:if>
6832
+ <xsl:call-template name="setImageWidthHeight"/>
6728
6833
 
6729
6834
  <xsl:choose>
6730
6835
  <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
@@ -6732,24 +6837,18 @@
6732
6837
  </xsl:when>
6733
6838
  <xsl:otherwise>
6734
6839
 
6735
- <xsl:variable name="img_src">
6736
- <xsl:choose>
6737
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6738
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6739
- </xsl:choose>
6840
+ <xsl:variable name="scale">
6841
+ <xsl:call-template name="getImageScale">
6842
+ <xsl:with-param name="indent" select="$indent"/>
6843
+ </xsl:call-template>
6740
6844
  </xsl:variable>
6741
6845
 
6742
- <xsl:variable name="image_width_effective">
6743
-
6744
- <xsl:value-of select="$width_effective"/>
6745
-
6846
+ <xsl:variable name="scaleRatio">
6847
+ 1
6746
6848
  </xsl:variable>
6747
6849
 
6748
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6749
6850
  <xsl:if test="number($scale) &lt; 100">
6750
-
6751
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
6752
-
6851
+ <xsl:attribute name="content-width"><xsl:value-of select="number($scale) * number($scaleRatio)"/>%</xsl:attribute>
6753
6852
  </xsl:if>
6754
6853
  </xsl:otherwise>
6755
6854
  </xsl:choose>
@@ -6765,6 +6864,62 @@
6765
6864
  </xsl:choose>
6766
6865
  </xsl:template>
6767
6866
 
6867
+ <xsl:template name="setImageWidth">
6868
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
6869
+ <xsl:value-of select="@width"/>
6870
+ </xsl:if>
6871
+ </xsl:template>
6872
+ <xsl:template name="setImageHeight">
6873
+ <xsl:if test="@height != '' and @height != 'auto'">
6874
+ <xsl:value-of select="@height"/>
6875
+ </xsl:if>
6876
+ </xsl:template>
6877
+ <xsl:template name="setImageWidthHeight">
6878
+ <xsl:variable name="width">
6879
+ <xsl:call-template name="setImageWidth"/>
6880
+ </xsl:variable>
6881
+ <xsl:if test="$width != ''">
6882
+ <xsl:attribute name="width">
6883
+ <xsl:value-of select="$width"/>
6884
+ </xsl:attribute>
6885
+ </xsl:if>
6886
+ <xsl:variable name="height">
6887
+ <xsl:call-template name="setImageHeight"/>
6888
+ </xsl:variable>
6889
+ <xsl:if test="$height != ''">
6890
+ <xsl:attribute name="height">
6891
+ <xsl:value-of select="$height"/>
6892
+ </xsl:attribute>
6893
+ </xsl:if>
6894
+ </xsl:template>
6895
+
6896
+ <xsl:template name="getImageScale">
6897
+ <xsl:param name="indent"/>
6898
+ <xsl:variable name="indent_left">
6899
+ <xsl:choose>
6900
+ <xsl:when test="$indent != ''"><xsl:value-of select="$indent"/></xsl:when>
6901
+ <xsl:otherwise>0</xsl:otherwise>
6902
+ </xsl:choose>
6903
+ </xsl:variable>
6904
+ <xsl:variable name="img_src">
6905
+ <xsl:choose>
6906
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
6907
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
6908
+ </xsl:choose>
6909
+ </xsl:variable>
6910
+
6911
+ <xsl:variable name="image_width_effective">
6912
+
6913
+ <xsl:value-of select="$width_effective - number($indent_left)"/>
6914
+
6915
+ </xsl:variable>
6916
+ <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
6917
+ <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
6918
+ <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
6919
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
6920
+ <xsl:value-of select="$scale"/>
6921
+ </xsl:template>
6922
+
6768
6923
  <xsl:template name="image_src">
6769
6924
  <xsl:choose>
6770
6925
  <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
@@ -9443,6 +9598,7 @@
9443
9598
  </xsl:template>
9444
9599
 
9445
9600
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
9601
+ <xsl:param name="indent">0</xsl:param>
9446
9602
  <xsl:choose>
9447
9603
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
9448
9604
  <fo:block-container role="SKIP">
@@ -9457,7 +9613,9 @@
9457
9613
 
9458
9614
  <fo:block-container margin-left="0mm" role="SKIP">
9459
9615
  <fo:block>
9460
- <xsl:apply-templates select="." mode="list"/>
9616
+ <xsl:apply-templates select="." mode="list">
9617
+ <xsl:with-param name="indent" select="$indent"/>
9618
+ </xsl:apply-templates>
9461
9619
  </fo:block>
9462
9620
  </fo:block-container>
9463
9621
  </fo:block-container>
@@ -9465,7 +9623,9 @@
9465
9623
  <xsl:otherwise>
9466
9624
 
9467
9625
  <fo:block role="SKIP">
9468
- <xsl:apply-templates select="." mode="list"/>
9626
+ <xsl:apply-templates select="." mode="list">
9627
+ <xsl:with-param name="indent" select="$indent"/>
9628
+ </xsl:apply-templates>
9469
9629
  </fo:block>
9470
9630
 
9471
9631
  </xsl:otherwise>
@@ -9550,6 +9710,13 @@
9550
9710
  </xsl:template>
9551
9711
 
9552
9712
  <xsl:template match="*[local-name()='li']">
9713
+ <xsl:param name="indent">0</xsl:param>
9714
+ <!-- <fo:list-item xsl:use-attribute-sets="list-item-style">
9715
+ <fo:list-item-label end-indent="label-end()"><fo:block>x</fo:block></fo:list-item-label>
9716
+ <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9717
+ <fo:block>debug li indent=<xsl:value-of select="$indent"/></fo:block>
9718
+ </fo:list-item-body>
9719
+ </fo:list-item> -->
9553
9720
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9554
9721
  <xsl:copy-of select="@id"/>
9555
9722
 
@@ -9574,7 +9741,9 @@
9574
9741
 
9575
9742
  <xsl:call-template name="refine_list-item-body-style"/>
9576
9743
 
9577
- <xsl:apply-templates/>
9744
+ <xsl:apply-templates>
9745
+ <xsl:with-param name="indent" select="$indent"/>
9746
+ </xsl:apply-templates>
9578
9747
 
9579
9748
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
9580
9749
 
@@ -11713,6 +11882,4 @@
11713
11882
  </xsl:if>
11714
11883
  </xsl:template>
11715
11884
 
11716
- <!-- update -->
11717
-
11718
11885
  </xsl:stylesheet>
@@ -95,7 +95,7 @@
95
95
  <text/>
96
96
  </element>
97
97
  </define>
98
- <define name="LocalizedString1">
98
+ <define name="LocalizedStringAttrs">
99
99
  <optional>
100
100
  <!-- multiple languages and scripts possible: comma delimit them if so -->
101
101
  <attribute name="language"/>
@@ -106,6 +106,10 @@
106
106
  <optional>
107
107
  <attribute name="script"/>
108
108
  </optional>
109
+ </define>
110
+ <define name="LocalizedString1">
111
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
112
+ <ref name="LocalizedStringAttrs"/>
109
113
  <text/>
110
114
  </define>
111
115
  <define name="LocalizedString">
@@ -142,16 +146,8 @@
142
146
  <ref name="LocalizedStringOrXsAny"/>
143
147
  </define>
144
148
  <define name="LocalizedStringOrXsAny1">
145
- <optional>
146
- <!-- multiple languages and scripts possible: comma delimit them if so -->
147
- <attribute name="language"/>
148
- </optional>
149
- <optional>
150
- <attribute name="locale"/>
151
- </optional>
152
- <optional>
153
- <attribute name="script"/>
154
- </optional>
149
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
150
+ <ref name="LocalizedStringAttrs"/>
155
151
  <oneOrMore>
156
152
  <choice>
157
153
  <text/>
@@ -208,6 +204,7 @@
208
204
  </define>
209
205
  <define name="roledescription">
210
206
  <element name="description">
207
+ <ref name="LocalizedStringAttrs"/>
211
208
  <oneOrMore>
212
209
  <ref name="TextElement"/>
213
210
  </oneOrMore>
@@ -335,6 +332,7 @@
335
332
  </define>
336
333
  <define name="affiliationdescription">
337
334
  <element name="description">
335
+ <ref name="LocalizedStringAttrs"/>
338
336
  <oneOrMore>
339
337
  <ref name="TextElement"/>
340
338
  </oneOrMore>
@@ -948,6 +946,7 @@
948
946
  <optional>
949
947
  <attribute name="type"/>
950
948
  </optional>
949
+ <ref name="LocalizedStringAttrs"/>
951
950
  <zeroOrMore>
952
951
  <ref name="TextElement"/>
953
952
  </zeroOrMore>
@@ -1041,15 +1040,7 @@
1041
1040
  <data type="boolean"/>
1042
1041
  </attribute>
1043
1042
  </optional>
1044
- <optional>
1045
- <attribute name="language"/>
1046
- </optional>
1047
- <optional>
1048
- <attribute name="locale"/>
1049
- </optional>
1050
- <optional>
1051
- <attribute name="script"/>
1052
- </optional>
1043
+ <ref name="LocalizedStringAttrs"/>
1053
1044
  <oneOrMore>
1054
1045
  <ref name="TextElement"/>
1055
1046
  </oneOrMore>
@@ -1277,6 +1268,7 @@
1277
1268
  <optional>
1278
1269
  <attribute name="type"/>
1279
1270
  </optional>
1271
+ <ref name="LocalizedStringAttrs"/>
1280
1272
  <oneOrMore>
1281
1273
  <ref name="TextElement"/>
1282
1274
  </oneOrMore>
@@ -1284,9 +1276,15 @@
1284
1276
  </define>
1285
1277
  <define name="bibabstract">
1286
1278
  <element name="abstract">
1287
- <oneOrMore>
1288
- <ref name="TextElement"/>
1289
- </oneOrMore>
1279
+ <ref name="LocalizedStringAttrs"/>
1280
+ <choice>
1281
+ <oneOrMore>
1282
+ <ref name="BasicBlock"/>
1283
+ </oneOrMore>
1284
+ <oneOrMore>
1285
+ <ref name="TextElement"/>
1286
+ </oneOrMore>
1287
+ </choice>
1290
1288
  </element>
1291
1289
  </define>
1292
1290
  <define name="copyright">
@@ -1391,6 +1389,7 @@
1391
1389
  </attribute>
1392
1390
  <optional>
1393
1391
  <element name="description">
1392
+ <ref name="LocalizedStringAttrs"/>
1394
1393
  <oneOrMore>
1395
1394
  <ref name="TextElement"/>
1396
1395
  </oneOrMore>
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.0 -->
20
+ <!-- VERSION v1.3.1 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -1346,38 +1346,41 @@
1346
1346
  </oneOrMore>
1347
1347
  </element>
1348
1348
  </define>
1349
+ <define name="Section-Attributes">
1350
+ <optional>
1351
+ <attribute name="id">
1352
+ <data type="ID"/>
1353
+ </attribute>
1354
+ </optional>
1355
+ <optional>
1356
+ <attribute name="language"/>
1357
+ </optional>
1358
+ <optional>
1359
+ <attribute name="script"/>
1360
+ </optional>
1361
+ <optional>
1362
+ <attribute name="inline-header">
1363
+ <data type="boolean"/>
1364
+ </attribute>
1365
+ </optional>
1366
+ <optional>
1367
+ <attribute name="number"/>
1368
+ </optional>
1369
+ <optional>
1370
+ <attribute name="branch-number"/>
1371
+ </optional>
1372
+ <optional>
1373
+ <attribute name="obligation">
1374
+ <choice>
1375
+ <value>normative</value>
1376
+ <value>informative</value>
1377
+ </choice>
1378
+ </attribute>
1379
+ </optional>
1380
+ </define>
1349
1381
  <define name="reference-clause">
1350
1382
  <element name="clause">
1351
- <optional>
1352
- <attribute name="id">
1353
- <data type="ID"/>
1354
- </attribute>
1355
- </optional>
1356
- <optional>
1357
- <attribute name="language"/>
1358
- </optional>
1359
- <optional>
1360
- <attribute name="script"/>
1361
- </optional>
1362
- <optional>
1363
- <attribute name="inline-header">
1364
- <data type="boolean"/>
1365
- </attribute>
1366
- </optional>
1367
- <optional>
1368
- <attribute name="number"/>
1369
- </optional>
1370
- <optional>
1371
- <attribute name="branch-number"/>
1372
- </optional>
1373
- <optional>
1374
- <attribute name="obligation">
1375
- <choice>
1376
- <value>normative</value>
1377
- <value>informative</value>
1378
- </choice>
1379
- </attribute>
1380
- </optional>
1383
+ <ref name="Section-Attributes"/>
1381
1384
  <optional>
1382
1385
  <ref name="section-title"/>
1383
1386
  </optional>
@@ -1566,36 +1569,7 @@
1566
1569
  </element>
1567
1570
  </define>
1568
1571
  <define name="Content-Section">
1569
- <optional>
1570
- <attribute name="id">
1571
- <data type="ID"/>
1572
- </attribute>
1573
- </optional>
1574
- <optional>
1575
- <attribute name="language"/>
1576
- </optional>
1577
- <optional>
1578
- <attribute name="script"/>
1579
- </optional>
1580
- <optional>
1581
- <attribute name="inline-header">
1582
- <data type="boolean"/>
1583
- </attribute>
1584
- </optional>
1585
- <optional>
1586
- <attribute name="obligation">
1587
- <choice>
1588
- <value>normative</value>
1589
- <value>informative</value>
1590
- </choice>
1591
- </attribute>
1592
- </optional>
1593
- <optional>
1594
- <attribute name="number"/>
1595
- </optional>
1596
- <optional>
1597
- <attribute name="branch-number"/>
1598
- </optional>
1572
+ <ref name="Section-Attributes"/>
1599
1573
  <optional>
1600
1574
  <attribute name="type"/>
1601
1575
  </optional>
@@ -1617,39 +1591,10 @@
1617
1591
  </element>
1618
1592
  </define>
1619
1593
  <define name="Clause-Section">
1620
- <optional>
1621
- <attribute name="id">
1622
- <data type="ID"/>
1623
- </attribute>
1624
- </optional>
1625
- <optional>
1626
- <attribute name="language"/>
1627
- </optional>
1628
- <optional>
1629
- <attribute name="script"/>
1630
- </optional>
1631
- <optional>
1632
- <attribute name="inline-header">
1633
- <data type="boolean"/>
1634
- </attribute>
1635
- </optional>
1636
- <optional>
1637
- <attribute name="obligation">
1638
- <choice>
1639
- <value>normative</value>
1640
- <value>informative</value>
1641
- </choice>
1642
- </attribute>
1643
- </optional>
1594
+ <ref name="Section-Attributes"/>
1644
1595
  <optional>
1645
1596
  <attribute name="type"/>
1646
1597
  </optional>
1647
- <optional>
1648
- <attribute name="number"/>
1649
- </optional>
1650
- <optional>
1651
- <attribute name="branch-number"/>
1652
- </optional>
1653
1598
  <optional>
1654
1599
  <ref name="section-title"/>
1655
1600
  </optional>
@@ -1730,34 +1675,10 @@
1730
1675
  </define>
1731
1676
  <define name="terms">
1732
1677
  <element name="terms">
1733
- <optional>
1734
- <attribute name="id">
1735
- <data type="ID"/>
1736
- </attribute>
1737
- </optional>
1738
- <optional>
1739
- <attribute name="language"/>
1740
- </optional>
1741
- <optional>
1742
- <attribute name="script"/>
1743
- </optional>
1678
+ <ref name="Section-Attributes"/>
1744
1679
  <optional>
1745
1680
  <attribute name="type"/>
1746
1681
  </optional>
1747
- <optional>
1748
- <attribute name="number"/>
1749
- </optional>
1750
- <optional>
1751
- <attribute name="branch-number"/>
1752
- </optional>
1753
- <optional>
1754
- <attribute name="obligation">
1755
- <choice>
1756
- <value>normative</value>
1757
- <value>informative</value>
1758
- </choice>
1759
- </attribute>
1760
- </optional>
1761
1682
  <optional>
1762
1683
  <ref name="section-title"/>
1763
1684
  </optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.4.5".freeze
3
+ VERSION = "2.4.7".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-25 00:00:00.000000000 Z
11
+ date: 2024-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic