doclang 0.7.3__tar.gz → 0.7.4__tar.gz

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.
Files changed (29) hide show
  1. {doclang-0.7.3 → doclang-0.7.4}/CHANGELOG.md +4 -0
  2. {doclang-0.7.3/doclang.egg-info → doclang-0.7.4}/PKG-INFO +1 -1
  3. {doclang-0.7.3 → doclang-0.7.4}/doclang/doclang.sch +28 -28
  4. {doclang-0.7.3 → doclang-0.7.4}/doclang/doclang.xsd +1 -1
  5. {doclang-0.7.3 → doclang-0.7.4/doclang.egg-info}/PKG-INFO +1 -1
  6. {doclang-0.7.3 → doclang-0.7.4}/pyproject.toml +1 -1
  7. {doclang-0.7.3 → doclang-0.7.4}/LICENSE +0 -0
  8. {doclang-0.7.3 → doclang-0.7.4}/MANIFEST.in +0 -0
  9. {doclang-0.7.3 → doclang-0.7.4}/README.md +0 -0
  10. {doclang-0.7.3 → doclang-0.7.4}/doclang/README.md +0 -0
  11. {doclang-0.7.3 → doclang-0.7.4}/doclang/__init__.py +0 -0
  12. {doclang-0.7.3 → doclang-0.7.4}/doclang/_packaging.py +0 -0
  13. {doclang-0.7.3 → doclang-0.7.4}/doclang/_schemas.py +0 -0
  14. {doclang-0.7.3 → doclang-0.7.4}/doclang/backends/__init__.py +0 -0
  15. {doclang-0.7.3 → doclang-0.7.4}/doclang/backends/_svrl.py +0 -0
  16. {doclang-0.7.3 → doclang-0.7.4}/doclang/backends/saxonche.py +0 -0
  17. {doclang-0.7.3 → doclang-0.7.4}/doclang/cli.py +0 -0
  18. {doclang-0.7.3 → doclang-0.7.4}/doclang/packaging.py +0 -0
  19. {doclang-0.7.3 → doclang-0.7.4}/doclang/schematron.py +0 -0
  20. {doclang-0.7.3 → doclang-0.7.4}/doclang/utils.py +0 -0
  21. {doclang-0.7.3 → doclang-0.7.4}/doclang/validation.py +0 -0
  22. {doclang-0.7.3 → doclang-0.7.4}/doclang/version.py +0 -0
  23. {doclang-0.7.3 → doclang-0.7.4}/doclang/xsd_validation.py +0 -0
  24. {doclang-0.7.3 → doclang-0.7.4}/doclang.egg-info/SOURCES.txt +0 -0
  25. {doclang-0.7.3 → doclang-0.7.4}/doclang.egg-info/dependency_links.txt +0 -0
  26. {doclang-0.7.3 → doclang-0.7.4}/doclang.egg-info/entry_points.txt +0 -0
  27. {doclang-0.7.3 → doclang-0.7.4}/doclang.egg-info/requires.txt +0 -0
  28. {doclang-0.7.3 → doclang-0.7.4}/doclang.egg-info/top_level.txt +0 -0
  29. {doclang-0.7.3 → doclang-0.7.4}/setup.cfg +0 -0
@@ -1,3 +1,7 @@
1
+ ## [v0.7.4](https://github.com/doclang-project/doclang/releases/tag/v0.7.4)
2
+
3
+ * fix element head rules for all their elements (#214)
4
+
1
5
  ## [v0.7.3](https://github.com/doclang-project/doclang/releases/tag/v0.7.3)
2
6
 
3
7
  * refuse symbolic links when packing pages and assets (#171)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: doclang
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: DocLang reference toolkit
5
5
  Author: DocLang Project
6
6
  License-Expression: Apache-2.0
@@ -10,6 +10,8 @@
10
10
  <!-- ============================================ -->
11
11
  <!-- NOTE: Element head order is enforced by XSD element_head group -->
12
12
  <!-- Schematron only validates structural tokens (ldiv for lists, cell tokens for tables) -->
13
+ <!-- Rule contexts are single paths (e.g. *[self::dl:a or self::dl:b], not dl:a | dl:b), so that every backend applies -->
14
+ <!-- them the same, including ones that only apply the first branch of a union -->
13
15
  <!-- ============================================ -->
14
16
 
15
17
  <!-- ============================================ -->
@@ -32,7 +34,7 @@
32
34
  <!-- ============================================ -->
33
35
 
34
36
  <sch:pattern id="table-structure">
35
- <sch:rule context="dl:table[*] | dl:index[*]">
37
+ <sch:rule context="*[self::dl:table or self::dl:index][*]">
36
38
  <sch:let name="first-non-header" value="*[not(self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom)][1]"/>
37
39
 
38
40
  <sch:assert test="not($first-non-header) or
@@ -51,7 +53,7 @@
51
53
  <!-- ============================================ -->
52
54
 
53
55
  <sch:pattern id="table-rectangular-grid">
54
- <sch:rule context="dl:table[dl:nl] | dl:index[dl:nl]">
56
+ <sch:rule context="*[self::dl:table or self::dl:index][dl:nl]">
55
57
  <!-- Define cell-starting tokens (tokens that begin a new cell) -->
56
58
  <sch:let name="cell-tokens" value="dl:fcel | dl:ecel | dl:ched | dl:rhed | dl:corn | dl:srow | dl:lcel | dl:ucel | dl:xcel"/>
57
59
 
@@ -77,10 +79,10 @@
77
79
  <!-- ============================================ -->
78
80
 
79
81
  <sch:pattern id="element-head-placement">
80
- <sch:rule context="dl:text | dl:heading | dl:code | dl:formula | dl:caption | dl:description | dl:summary |
81
- dl:page_header | dl:page_footer | dl:footnote | dl:picture | dl:marker |
82
- dl:field_region | dl:field_heading | dl:field_item | dl:key | dl:value |
83
- dl:list | dl:table | dl:index | dl:group">
82
+ <sch:rule context="*[self::dl:text or self::dl:heading or self::dl:code or self::dl:formula or self::dl:caption or
83
+ self::dl:description or self::dl:summary or self::dl:page_header or self::dl:page_footer or
84
+ self::dl:footnote or self::dl:picture or self::dl:marker or self::dl:field_region or
85
+ self::dl:field_heading or self::dl:field_item or self::dl:key or self::dl:value or self::dl:group]">
84
86
  <sch:let name="header-elements" value="dl:label | dl:thread | dl:xref | dl:href | dl:layer | dl:location | dl:caption | dl:description | dl:summary | dl:custom"/>
85
87
 
86
88
  <sch:let name="text-before-header" value="text()[following-sibling::*[self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom]]"/>
@@ -90,6 +92,20 @@
90
92
  Found non-whitespace text before element head: '<sch:value-of select="normalize-space(string-join($text-before-header, ''))"/>'
91
93
  </sch:assert>
92
94
  </sch:rule>
95
+
96
+ <!-- containers: only their own head (before the first body element) is checked here; -->
97
+ <!-- the heads of their items and cells are checked by the virtual text rules -->
98
+ <sch:rule context="*[self::dl:list or self::dl:table or self::dl:index]">
99
+ <sch:let name="first-body" value="*[not(self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom)][1]"/>
100
+
101
+ <sch:let name="text-before-header" value="text()[following-sibling::*[self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom]
102
+ [not($first-body) or . &lt;&lt; $first-body]]"/>
103
+
104
+ <sch:assert test="every $t in $text-before-header satisfies normalize-space($t) = ''">
105
+ Property elements in the element head (label, thread, xref, href, layer, location, caption, description, summary, custom) must appear before any non-whitespace text content.
106
+ Found non-whitespace text before element head: '<sch:value-of select="normalize-space(string-join($text-before-header, ''))"/>'
107
+ </sch:assert>
108
+ </sch:rule>
93
109
  </sch:pattern>
94
110
 
95
111
  <!-- ============================================ -->
@@ -238,14 +254,8 @@
238
254
 
239
255
  <sch:let name="header-elements" value="$item-content[self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom]"/>
240
256
 
241
- <sch:let name="first-header-index" value="if ($header-elements)
242
- then index-of($item-content, $header-elements[1])[1]
243
- else 0"/>
244
-
245
- <sch:let name="text-before-header" value="if ($first-header-index > 0)
246
- then for $i in 1 to ($first-header-index - 1)
247
- return $item-content[$i][self::text()][normalize-space(.) != '']
248
- else ()"/>
257
+ <!-- compared by position in the document (not by value: e.g. empty elements would all be equal) -->
258
+ <sch:let name="text-before-header" value="$item-content[self::text()][normalize-space(.) != ''][. &lt;&lt; $header-elements[1]]"/>
249
259
 
250
260
  <sch:assert test="empty($text-before-header)">
251
261
  In list items (virtual text), property elements in the element head (label, thread, xref, href, layer, location, caption, description, summary, custom) must appear before any non-whitespace text content.
@@ -261,12 +271,8 @@
261
271
  <!-- ============================================ -->
262
272
 
263
273
  <sch:pattern id="table-virtual-text-element-head">
264
- <sch:rule context="dl:table/dl:fcel | dl:table/dl:ecel | dl:table/dl:ched |
265
- dl:table/dl:rhed | dl:table/dl:corn | dl:table/dl:srow |
266
- dl:table/dl:lcel | dl:table/dl:ucel | dl:table/dl:xcel |
267
- dl:index/dl:fcel | dl:index/dl:ecel | dl:index/dl:ched |
268
- dl:index/dl:rhed | dl:index/dl:corn | dl:index/dl:srow |
269
- dl:index/dl:lcel | dl:index/dl:ucel | dl:index/dl:xcel">
274
+ <sch:rule context="*[self::dl:fcel or self::dl:ecel or self::dl:ched or self::dl:rhed or self::dl:corn or self::dl:srow or
275
+ self::dl:lcel or self::dl:ucel or self::dl:xcel][parent::dl:table or parent::dl:index]">
270
276
  <sch:let name="next-token" value="following-sibling::*[self::dl:fcel or self::dl:ecel or self::dl:ched or
271
277
  self::dl:rhed or self::dl:corn or self::dl:srow or
272
278
  self::dl:lcel or self::dl:ucel or self::dl:xcel or
@@ -278,14 +284,8 @@
278
284
 
279
285
  <sch:let name="header-elements" value="$cell-content[self::dl:label or self::dl:thread or self::dl:xref or self::dl:href or self::dl:layer or self::dl:location or self::dl:caption or self::dl:description or self::dl:summary or self::dl:custom]"/>
280
286
 
281
- <sch:let name="first-header-index" value="if ($header-elements)
282
- then index-of($cell-content, $header-elements[1])[1]
283
- else 0"/>
284
-
285
- <sch:let name="text-before-header" value="if ($first-header-index > 0)
286
- then for $i in 1 to ($first-header-index - 1)
287
- return $cell-content[$i][self::text()][normalize-space(.) != '']
288
- else ()"/>
287
+ <!-- compared by position in the document (not by value: e.g. empty elements would all be equal) -->
288
+ <sch:let name="text-before-header" value="$cell-content[self::text()][normalize-space(.) != ''][. &lt;&lt; $header-elements[1]]"/>
289
289
 
290
290
  <sch:assert test="empty($text-before-header)">
291
291
  In table and index cells (virtual text), property elements in the element head (label, thread, xref, href, layer, location, caption, description, summary, custom) must appear before any non-whitespace text content.
@@ -5,7 +5,7 @@
5
5
  xmlns:dl="https://www.doclang.ai/ns/v0"
6
6
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
7
7
  elementFormDefault="qualified"
8
- version="0.7.3"
8
+ version="0.7.4"
9
9
  >
10
10
 
11
11
  <!-- ============================================ -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: doclang
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: DocLang reference toolkit
5
5
  Author: DocLang Project
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "doclang"
7
- version = "0.7.3" # DO NOT EDIT MANUALLY, updated automatically
7
+ version = "0.7.4" # DO NOT EDIT MANUALLY, updated automatically
8
8
  description = "DocLang reference toolkit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes