metanorma-ieee 0.0.7 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce71f154bdfaa827f1a337ada1d43e55c308bc06a188c458459bc61a5973016e
4
- data.tar.gz: d2d1ca8358e682e13d6dc590ddcd49a0f3948245ac31263dff040f9cda539e48
3
+ metadata.gz: 05e99861807be4a3295ae7642f381419eef870dee2dd2b1f8df22391342acb45
4
+ data.tar.gz: d79bf191d766d6a705d612b806e81ddc800d09efe985191258f09b588a916f85
5
5
  SHA512:
6
- metadata.gz: 1c6f49824460407ffad065878704794d3669f5da4f6d7b2c385d46bdb63558f7c82332b937423fa8ba0adc12a2d37cdac08faba6649b0da780b6c8d02bd40a95
7
- data.tar.gz: a74afb17ed30afd997a4e4bc435222e3886671897b41035bb401e9d6762476094b7096a6688fe14da3e5144f8acce9d6a90ffcc5c69f87105e773b32990522fb
6
+ metadata.gz: be97ca0b1c97744f41e69719dc70e430fb67092b6bbc184d7d59292a49b153acbb772db3d35e22b0e359d092fb6c42ff0385aca16ad4ada89966d753113219e0
7
+ data.tar.gz: 6480760c5aab6e43318585c05bfed56ae85e568ac84a50267518e8a40f05a34f9998cddb2cbc8d52dfccfd698d08df835ddfb372870de0d737763f7fd23e2457
@@ -0,0 +1,31 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ # source: https://github.com/marketplace/actions/merge-pull-requests#usage
4
+ name: automerge
5
+ on:
6
+ pull_request:
7
+ types:
8
+ - labeled
9
+ - unlabeled
10
+ - synchronize
11
+ - opened
12
+ - edited
13
+ - ready_for_review
14
+ - reopened
15
+ - unlocked
16
+ pull_request_review:
17
+ types:
18
+ - submitted
19
+ check_suite:
20
+ types:
21
+ - completed
22
+ status: {}
23
+ jobs:
24
+ automerge:
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - id: automerge
28
+ name: automerge
29
+ uses: "pascalgn/automerge-action@v0.15.3"
30
+ env:
31
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
@@ -579,7 +579,7 @@ div.figure {
579
579
  font-weight: 700;
580
580
  font-size: 1em;
581
581
  text-align: center; }
582
- div.figure > img {
582
+ div.figure > img, div.figure > svg {
583
583
  margin-left: auto;
584
584
  margin-right: auto;
585
585
  display: block;
@@ -7249,8 +7249,17 @@
7249
7249
  </fo:inline>
7250
7250
  </xsl:template> <!-- tt -->
7251
7251
 
7252
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
7252
7253
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
7253
- <xsl:call-template name="add_spaces_to_sourcecode"/>
7254
+ <xsl:choose>
7255
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
7256
+ <!-- url -->
7257
+ <xsl:call-template name="add-zero-spaces-link-java"/>
7258
+ </xsl:when>
7259
+ <xsl:otherwise>
7260
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
7261
+ </xsl:otherwise>
7262
+ </xsl:choose>
7254
7263
  </xsl:template>
7255
7264
 
7256
7265
  <xsl:template match="*[local-name()='underline']">
@@ -7606,8 +7615,11 @@
7606
7615
 
7607
7616
  <xsl:template name="add-zero-spaces-link-java">
7608
7617
  <xsl:param name="text" select="."/>
7618
+
7619
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
7620
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
7609
7621
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
7610
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
7622
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
7611
7623
  </xsl:template>
7612
7624
 
7613
7625
  <!-- add zero space after dash character (for table's entries) -->
@@ -10587,7 +10599,7 @@
10587
10599
  <!-- ====== -->
10588
10600
  <!-- eref -->
10589
10601
  <!-- ====== -->
10590
- <xsl:template match="*[local-name() = 'eref']">
10602
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
10591
10603
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
10592
10604
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
10593
10605
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -11098,21 +11110,29 @@
11098
11110
  </xsl:variable>
11099
11111
 
11100
11112
  <xsl:template match="@*|node()" mode="index_add_id">
11113
+ <xsl:param name="docid"/>
11101
11114
  <xsl:copy>
11102
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
11115
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
11116
+ <xsl:with-param name="docid" select="$docid"/>
11117
+ </xsl:apply-templates>
11103
11118
  </xsl:copy>
11104
11119
  </xsl:template>
11105
11120
 
11106
11121
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
11122
+ <xsl:param name="docid"/>
11107
11123
  <xsl:variable name="id">
11108
- <xsl:call-template name="generateIndexXrefId"/>
11124
+ <xsl:call-template name="generateIndexXrefId">
11125
+ <xsl:with-param name="docid" select="$docid"/>
11126
+ </xsl:call-template>
11109
11127
  </xsl:variable>
11110
11128
  <xsl:copy> <!-- add id to xref -->
11111
11129
  <xsl:apply-templates select="@*" mode="index_add_id"/>
11112
11130
  <xsl:attribute name="id">
11113
11131
  <xsl:value-of select="$id"/>
11114
11132
  </xsl:attribute>
11115
- <xsl:apply-templates mode="index_add_id"/>
11133
+ <xsl:apply-templates mode="index_add_id">
11134
+ <xsl:with-param name="docid" select="$docid"/>
11135
+ </xsl:apply-templates>
11116
11136
  </xsl:copy>
11117
11137
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
11118
11138
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -11124,7 +11144,9 @@
11124
11144
  <xsl:attribute name="id">
11125
11145
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
11126
11146
  </xsl:attribute>
11127
- <xsl:apply-templates mode="index_add_id"/>
11147
+ <xsl:apply-templates mode="index_add_id">
11148
+ <xsl:with-param name="docid" select="$docid"/>
11149
+ </xsl:apply-templates>
11128
11150
  </xsl:copy>
11129
11151
  </xsl:if>
11130
11152
  </xsl:template>
@@ -11161,12 +11183,33 @@
11161
11183
  </xsl:when>
11162
11184
  <xsl:when test="self::* and local-name(.) = 'xref'">
11163
11185
  <xsl:variable name="id" select="@id"/>
11164
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
11165
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
11166
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
11167
11186
 
11187
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
11168
11188
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
11169
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
11189
+
11190
+ <xsl:variable name="pages_">
11191
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
11192
+ <xsl:choose>
11193
+ <xsl:when test="@id = $id">
11194
+ <page><xsl:value-of select="."/></page>
11195
+ </xsl:when>
11196
+ <xsl:when test="@id = $id_next">
11197
+ <page_next><xsl:value-of select="."/></page_next>
11198
+ </xsl:when>
11199
+ <xsl:when test="@id = $id_prev">
11200
+ <page_prev><xsl:value-of select="."/></page_prev>
11201
+ </xsl:when>
11202
+ </xsl:choose>
11203
+ </xsl:for-each>
11204
+ </xsl:variable>
11205
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
11206
+
11207
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
11208
+ <xsl:variable name="page" select="$pages/page"/>
11209
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
11210
+ <xsl:variable name="page_next" select="$pages/page_next"/>
11211
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
11212
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
11170
11213
 
11171
11214
  <xsl:choose>
11172
11215
  <!-- 2nd pass -->
@@ -11226,16 +11269,20 @@
11226
11269
  </xsl:template>
11227
11270
 
11228
11271
  <xsl:template name="generateIndexXrefId">
11272
+ <xsl:param name="docid"/>
11273
+
11229
11274
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
11230
11275
 
11231
- <xsl:variable name="docid">
11232
- <xsl:call-template name="getDocumentId"/>
11276
+ <xsl:variable name="docid_curr">
11277
+ <xsl:value-of select="$docid"/>
11278
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
11233
11279
  </xsl:variable>
11280
+
11234
11281
  <xsl:variable name="item_number">
11235
11282
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
11236
11283
  </xsl:variable>
11237
11284
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
11238
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
11285
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
11239
11286
  </xsl:template>
11240
11287
 
11241
11288
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -12173,7 +12220,7 @@
12173
12220
 
12174
12221
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
12175
12222
 
12176
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12223
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12177
12224
 
12178
12225
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
12179
12226
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -7249,8 +7249,17 @@
7249
7249
  </fo:inline>
7250
7250
  </xsl:template> <!-- tt -->
7251
7251
 
7252
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
7252
7253
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
7253
- <xsl:call-template name="add_spaces_to_sourcecode"/>
7254
+ <xsl:choose>
7255
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
7256
+ <!-- url -->
7257
+ <xsl:call-template name="add-zero-spaces-link-java"/>
7258
+ </xsl:when>
7259
+ <xsl:otherwise>
7260
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
7261
+ </xsl:otherwise>
7262
+ </xsl:choose>
7254
7263
  </xsl:template>
7255
7264
 
7256
7265
  <xsl:template match="*[local-name()='underline']">
@@ -7606,8 +7615,11 @@
7606
7615
 
7607
7616
  <xsl:template name="add-zero-spaces-link-java">
7608
7617
  <xsl:param name="text" select="."/>
7618
+
7619
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
7620
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
7609
7621
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
7610
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
7622
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
7611
7623
  </xsl:template>
7612
7624
 
7613
7625
  <!-- add zero space after dash character (for table's entries) -->
@@ -10587,7 +10599,7 @@
10587
10599
  <!-- ====== -->
10588
10600
  <!-- eref -->
10589
10601
  <!-- ====== -->
10590
- <xsl:template match="*[local-name() = 'eref']">
10602
+ <xsl:template match="*[local-name() = 'eref']" name="eref">
10591
10603
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
10592
10604
  <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
10593
10605
  <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
@@ -11098,21 +11110,29 @@
11098
11110
  </xsl:variable>
11099
11111
 
11100
11112
  <xsl:template match="@*|node()" mode="index_add_id">
11113
+ <xsl:param name="docid"/>
11101
11114
  <xsl:copy>
11102
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
11115
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
11116
+ <xsl:with-param name="docid" select="$docid"/>
11117
+ </xsl:apply-templates>
11103
11118
  </xsl:copy>
11104
11119
  </xsl:template>
11105
11120
 
11106
11121
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
11122
+ <xsl:param name="docid"/>
11107
11123
  <xsl:variable name="id">
11108
- <xsl:call-template name="generateIndexXrefId"/>
11124
+ <xsl:call-template name="generateIndexXrefId">
11125
+ <xsl:with-param name="docid" select="$docid"/>
11126
+ </xsl:call-template>
11109
11127
  </xsl:variable>
11110
11128
  <xsl:copy> <!-- add id to xref -->
11111
11129
  <xsl:apply-templates select="@*" mode="index_add_id"/>
11112
11130
  <xsl:attribute name="id">
11113
11131
  <xsl:value-of select="$id"/>
11114
11132
  </xsl:attribute>
11115
- <xsl:apply-templates mode="index_add_id"/>
11133
+ <xsl:apply-templates mode="index_add_id">
11134
+ <xsl:with-param name="docid" select="$docid"/>
11135
+ </xsl:apply-templates>
11116
11136
  </xsl:copy>
11117
11137
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
11118
11138
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -11124,7 +11144,9 @@
11124
11144
  <xsl:attribute name="id">
11125
11145
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
11126
11146
  </xsl:attribute>
11127
- <xsl:apply-templates mode="index_add_id"/>
11147
+ <xsl:apply-templates mode="index_add_id">
11148
+ <xsl:with-param name="docid" select="$docid"/>
11149
+ </xsl:apply-templates>
11128
11150
  </xsl:copy>
11129
11151
  </xsl:if>
11130
11152
  </xsl:template>
@@ -11161,12 +11183,33 @@
11161
11183
  </xsl:when>
11162
11184
  <xsl:when test="self::* and local-name(.) = 'xref'">
11163
11185
  <xsl:variable name="id" select="@id"/>
11164
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
11165
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
11166
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
11167
11186
 
11187
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
11168
11188
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
11169
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
11189
+
11190
+ <xsl:variable name="pages_">
11191
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
11192
+ <xsl:choose>
11193
+ <xsl:when test="@id = $id">
11194
+ <page><xsl:value-of select="."/></page>
11195
+ </xsl:when>
11196
+ <xsl:when test="@id = $id_next">
11197
+ <page_next><xsl:value-of select="."/></page_next>
11198
+ </xsl:when>
11199
+ <xsl:when test="@id = $id_prev">
11200
+ <page_prev><xsl:value-of select="."/></page_prev>
11201
+ </xsl:when>
11202
+ </xsl:choose>
11203
+ </xsl:for-each>
11204
+ </xsl:variable>
11205
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
11206
+
11207
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
11208
+ <xsl:variable name="page" select="$pages/page"/>
11209
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
11210
+ <xsl:variable name="page_next" select="$pages/page_next"/>
11211
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
11212
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
11170
11213
 
11171
11214
  <xsl:choose>
11172
11215
  <!-- 2nd pass -->
@@ -11226,16 +11269,20 @@
11226
11269
  </xsl:template>
11227
11270
 
11228
11271
  <xsl:template name="generateIndexXrefId">
11272
+ <xsl:param name="docid"/>
11273
+
11229
11274
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
11230
11275
 
11231
- <xsl:variable name="docid">
11232
- <xsl:call-template name="getDocumentId"/>
11276
+ <xsl:variable name="docid_curr">
11277
+ <xsl:value-of select="$docid"/>
11278
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
11233
11279
  </xsl:variable>
11280
+
11234
11281
  <xsl:variable name="item_number">
11235
11282
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
11236
11283
  </xsl:variable>
11237
11284
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
11238
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
11285
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
11239
11286
  </xsl:template>
11240
11287
 
11241
11288
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -12173,7 +12220,7 @@
12173
12220
 
12174
12221
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
12175
12222
 
12176
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12223
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
12177
12224
 
12178
12225
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
12179
12226
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -0,0 +1,36 @@
1
+ require "isodoc"
2
+ require "mnconvert"
3
+
4
+ module IsoDoc
5
+ module IEEE
6
+ class IEEEXMLConvert < IsoDoc::XslfoPdfConvert
7
+ def initialize(options) # rubocop:disable Lint/MissingSuper
8
+ @libdir = File.dirname(__FILE__)
9
+ @format = :ieee
10
+ @suffix = "ieee.xml"
11
+ @ieeedtd = options[:ieeedtd]
12
+ end
13
+
14
+ def inputfile(in_fname, filename)
15
+ /\.xml$/.match?(in_fname) or
16
+ in_fname = Tempfile.open([filename, ".xml"], encoding: "utf-8") do |f|
17
+ f.write file
18
+ f.path
19
+ end
20
+ in_fname
21
+ end
22
+
23
+ def convert(in_fname, file = nil, debug = false, out_fname = nil)
24
+ file = File.read(in_fname, encoding: "utf-8") if file.nil?
25
+ _docxml, filename, dir = convert_init(file, in_fname, debug)
26
+ in_fname = inputfile(in_fname, filename)
27
+ FileUtils.rm_rf dir
28
+ opt = { input_format: MnConvert::InputFormat::MN,
29
+ output_file: out_fname || "#{filename}.#{@suffix}",
30
+ output_format: :ieee }
31
+ @ieeedtd and opt.merge!(validation_against: @ieeedtd)
32
+ MnConvert.convert(in_fname, opt)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -62,7 +62,7 @@ module IsoDoc
62
62
  linkend = linkend.sub(/^Clause /, "")
63
63
  container = @xrefs.anchor(node["target"], :container, false)
64
64
  prefix_container?(container, node) and
65
- linkend = prefix_container(container, linkend, node["target"])
65
+ linkend = prefix_container(container, linkend, node, node["target"])
66
66
  capitalise_xref(node, linkend, anchor_value(node["target"]))
67
67
  end
68
68
 
data/lib/isodoc/ieee.rb CHANGED
@@ -4,6 +4,7 @@ require "isodoc/ieee/html_convert"
4
4
  require "isodoc/ieee/pdf_convert"
5
5
  require "isodoc/ieee/word_convert"
6
6
  require "isodoc/ieee/presentation_xml_convert"
7
+ require "isodoc/ieee/ieee_xml_convert"
7
8
 
8
9
  module IsoDoc
9
10
  module IEEE
@@ -1,10 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng">
4
- <start>
5
- <ref name="document"/>
6
- </start>
7
- </include>
8
3
  <define name="document">
9
4
  <element name="document">
10
5
  <optional>
@@ -1125,26 +1120,4 @@
1125
1120
  </zeroOrMore>
1126
1121
  </element>
1127
1122
  </define>
1128
- <define name="ext">
1129
- <element name="ext">
1130
- <ref name="BibDataExtensionType"/>
1131
- </element>
1132
- </define>
1133
- <define name="BibDataExtensionType">
1134
- <ref name="doctype"/>
1135
- </define>
1136
- <define name="doctype">
1137
- <element name="doctype">
1138
- <ref name="DocumentType"/>
1139
- </element>
1140
- </define>
1141
- <define name="DocumentType">
1142
- <value>document</value>
1143
- </define>
1144
- <define name="BibData">
1145
- <ref name="BibliographicItem"/>
1146
- <optional>
1147
- <ref name="ext"/>
1148
- </optional>
1149
- </define>
1150
1123
  </grammar>
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
+ of relaton
6
+
7
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
+ -->
10
+ <include href="biblio.rng">
11
+ <define name="BibData">
12
+ <ref name="BibliographicItem"/>
13
+ <optional>
14
+ <ref name="ext"/>
15
+ </optional>
16
+ </define>
17
+ </include>
18
+ <define name="ext">
19
+ <element name="ext">
20
+ <ref name="BibDataExtensionType"/>
21
+ </element>
22
+ </define>
23
+ <define name="BibDataExtensionType">
24
+ <optional>
25
+ <attribute name="schema-version"/>
26
+ </optional>
27
+ <ref name="doctype"/>
28
+ <optional>
29
+ <ref name="docsubtype"/>
30
+ </optional>
31
+ <optional>
32
+ <ref name="editorialgroup"/>
33
+ </optional>
34
+ <zeroOrMore>
35
+ <ref name="ics"/>
36
+ </zeroOrMore>
37
+ <zeroOrMore>
38
+ <ref name="structuredidentifier"/>
39
+ </zeroOrMore>
40
+ </define>
41
+ <define name="doctype">
42
+ <element name="doctype">
43
+ <optional>
44
+ <attribute name="abbreviation"/>
45
+ </optional>
46
+ <ref name="DocumentType"/>
47
+ </element>
48
+ </define>
49
+ <define name="DocumentType">
50
+ <value>document</value>
51
+ </define>
52
+ <define name="docsubtype">
53
+ <element name="subdoctype">
54
+ <ref name="DocumentSubtype"/>
55
+ </element>
56
+ </define>
57
+ <define name="DocumentSubtype">
58
+ <text/>
59
+ </define>
60
+ <define name="editorialgroup">
61
+ <element name="editorialgroup">
62
+ <oneOrMore>
63
+ <ref name="technical-committee"/>
64
+ </oneOrMore>
65
+ </element>
66
+ </define>
67
+ <define name="technical-committee">
68
+ <element name="technical-committee">
69
+ <ref name="IsoWorkgroup"/>
70
+ </element>
71
+ </define>
72
+ <define name="IsoWorkgroup">
73
+ <optional>
74
+ <attribute name="number"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="type"/>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="identifier"/>
81
+ </optional>
82
+ <optional>
83
+ <attribute name="prefix"/>
84
+ </optional>
85
+ <text/>
86
+ </define>
87
+ <define name="ics">
88
+ <element name="ics">
89
+ <element name="code">
90
+ <text/>
91
+ </element>
92
+ <optional>
93
+ <element name="text">
94
+ <text/>
95
+ </element>
96
+ </optional>
97
+ </element>
98
+ </define>
99
+ <define name="structuredidentifier">
100
+ <element name="structuredidentifier">
101
+ <optional>
102
+ <attribute name="type"/>
103
+ </optional>
104
+ <oneOrMore>
105
+ <element name="agency">
106
+ <text/>
107
+ </element>
108
+ </oneOrMore>
109
+ <optional>
110
+ <element name="class">
111
+ <text/>
112
+ </element>
113
+ </optional>
114
+ <element name="docnumber">
115
+ <text/>
116
+ </element>
117
+ <optional>
118
+ <element name="partnumber">
119
+ <text/>
120
+ </element>
121
+ </optional>
122
+ <optional>
123
+ <element name="edition">
124
+ <text/>
125
+ </element>
126
+ </optional>
127
+ <optional>
128
+ <element name="version">
129
+ <text/>
130
+ </element>
131
+ </optional>
132
+ <optional>
133
+ <element name="supplementtype">
134
+ <text/>
135
+ </element>
136
+ </optional>
137
+ <optional>
138
+ <element name="supplementnumber">
139
+ <text/>
140
+ </element>
141
+ </optional>
142
+ <optional>
143
+ <element name="amendment">
144
+ <text/>
145
+ </element>
146
+ </optional>
147
+ <optional>
148
+ <element name="corrigendum">
149
+ <text/>
150
+ </element>
151
+ </optional>
152
+ <optional>
153
+ <element name="language">
154
+ <text/>
155
+ </element>
156
+ </optional>
157
+ <optional>
158
+ <element name="year">
159
+ <text/>
160
+ </element>
161
+ </optional>
162
+ </element>
163
+ </define>
164
+ </grammar>