test(fixtures): the STS fixtures and fixture codes are fictitious

Three STS fixtures still carried the section titles and labels of one real
reference document, and three identifiers were copies of its codes with a
letter or a word swapped. They now describe an invented kitchen counter and
cookbook series: the titles, labels and descriptions of sts-identity.xml,
sts-inherit.xml and sts-empty-label.xml, the P350/P351 document codes, the
99-0001 delivery prefix and chapter 7 of the image and accounting corpora.
Generated fixtures are regenerated and the witness inventory's per-document
totals are identical before and after; only names and text move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 14:50:44 +02:00
commit 88cf67f12e
65 changed files with 396 additions and 390 deletions

View file

@ -17,7 +17,7 @@ and reproducible from that one file.
|---|---|
| `two-line-krav.pdf` | One heading plus one requirement row with label and value on the **same line**. That pairing is the property `pdfplumber` was chosen for. |
| `no-text-layer.pdf` | A structurally valid page with no text operators — the shape a scanned or image-only PDF presents. Must fail fast (`extractor_empty_pdf`), never persist as an empty concept. |
| `outline-collision.pdf` | **Two bookmarks whose destinations resolve to the same line** — the tree's root node and a front-matter node, both on line 0, which is the shape a 701-page reference standard carries. The marks are collected in a dict keyed on the line index, so without this fixture the second node is dropped with nothing counting it: 2 763 nodes in, 2 762 marks out, `unresolved` at 0. A one-bookmark-per-line fixture cannot see that. |
| `outline-collision.pdf` | **Two bookmarks whose destinations resolve to the same line** — the tree's root node and a front-matter node, both on line 0, which is the shape a long reference standard carries. The marks are collected in a dict keyed on the line index, so without this fixture the second node is dropped with nothing counting it: N + 2 nodes in (N its declared sections), N + 1 marks out, `unresolved` at 0. A one-bookmark-per-line fixture cannot see that. |
| `three-page-krav.pdf` | Three pages, one line of text each, and **the middle page carries no text operators**. The extractor drops empty pages, so the last page's text belongs to page 3 — which is what separates a page NUMBER from a count of the pages that produced text. Two pages could not tell those apart. |
## The XML fixtures
@ -31,7 +31,7 @@ round-trip-symmetric defect.
| Fixture | What it is for |
|---|---|
| `sts-mini.xml` | The known-positive. A `<standard>` root with `<sec>` at three nesting levels carrying `<label>`+`<title>`, two lettered points (`a)`, `b)`) with a **label and no title**, one `<table-wrap>` with a label and two rows, `<p>` bodies, a `<list>`, and **one unnumbered section** (`Forord`, `<title>` with no `<label>`) mirroring the single such section in that reference standard. The lettered points are what the 4 954 label-only `<sec>` in that document look like: promoted to headings they would bury its own 2 761. |
| `sts-mini.xml` | The known-positive. A `<standard>` root with `<sec>` at three nesting levels carrying `<label>`+`<title>`, two lettered points (`a)`, `b)`) with a **label and no title**, one `<table-wrap>` with a label and two rows, `<p>` bodies, a `<list>`, and **one unnumbered section** (`Forord`, `<title>` with no `<label>`) mirroring the single such section in that reference standard. The lettered points are what the label-only `<sec>` in that document look like -- most (64 %) of its `<sec>`: promoted to headings they would bury its own N titled sections. |
| `sts-empty-label.xml` | A `<sec>` carrying a `<label>` and **nothing else**, between a lettered point that has a body and the next titled section. The label is held as a prefix for a body line that never arrives, so it was overwritten and lost: measured on the reference standard that is exactly one `x)`, two characters of 1 283 395, ratio 0.999998. An exact invariant does not get to be 0.999998. |
| `sts-identity.xml` | A document that **states who it is**: exactly one `<std-ident>` with a `<doc-number>` and a `<year>`, one `<title-wrap>` whose `<full>` carries a **comma** (as the reference standard's does, which is why that title cannot be written into a `sources` flow mapping verbatim), and a `<std-ref type="dated">`. Its body carries the `sec-type="spec"` shape the `description` rule reads: a titled `<sec>` whose first spec point has one `<p>`, a second spec point that must never become the description, a titled child with no spec point of its own, and a spec point with **two** `<p>` of which only the first counts. `sts-mini.xml` is the half identity (a `<title-wrap>`, no `<doc-number>`) and `sts-empty-label.xml` the absent one. |
| `generic-feed.xml` | Known-negative: XML that is **not** STS. It must produce text and ONE plan — never zero, never a crash, and never element names promoted to headings. |

View file

@ -1 +1 @@
{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}\pard Figur 84-1 viser prinsippet.\par\pard{\pict\pngblip\picw16\pich16 89504e470d0a1a0a}\par}
{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}\pard Figur 7-1 viser prinsippet.\par\pard{\pict\pngblip\picw16\pich16 89504e470d0a1a0a}\par}

View file

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="no">
<head><title>Figur 84-1</title></head>
<head><title>Figur 7-1</title></head>
<body>
<h1>Figur 84-1</h1>
<h1>Figur 7-1</h1>
<p>Prinsippet for hevetidsklasser.</p>
<img src="graphics/figur-84-1.png" alt="Prinsippskisse">
<img src="graphics/figur-7-1.png" alt="Prinsippskisse">
<table><tr><th>Klasse</th><th>Avvik</th></tr><tr><td>A</td><td>5 min</td></tr></table>
<ul><li>Klasse A</li><li>Klasse B</li></ul>
</body>

View file

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 94 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

Before After
Before After

Binary file not shown.

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
<front><std-ident><doc-number>P350</doc-number></std-ident></front>
<body>
<sec>
<label>7</label>
<title>Brød og boller</title>
<sec>
<label>7.1</label>
<title>Hevetider</title>
<p>Hevetidsklasse er gitt i tabell 7-2.</p>
<graphic xlink:href="graphics/tabell-7-2.png"/>
<p>Figur 7-1 viser prinsippet.</p>
<graphic xlink:href="figur-7-1.png"/>
</sec>
</sec>
</body>
</standard>

View file

@ -0,0 +1,14 @@
<!doctype html>
<html><head><title>Kapittel 7</title></head>
<body>
<h1>7 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 7-2.</p>
<img src="graphics/tabell-7-2.png" alt="Tabell 7-2 Hevetidsklasser">
<p>Figuren under viser prinsippet.</p>
<figure>
<img src="graphics/figur-7-1.png" alt="Figur 7-1 Prinsippskisse">
<figcaption>Figur 7-1 Prinsippskisse</figcaption>
</figure>
<p>Og en som ligger et annet sted:</p>
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
</body></html>

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
<front><std-ident><doc-number>P761</doc-number></std-ident></front>
<body>
<sec>
<label>84</label>
<title>Brød og boller</title>
<sec>
<label>84.1</label>
<title>Hevetider</title>
<p>Hevetidsklasse er gitt i tabell 84-2.</p>
<graphic xlink:href="graphics/tabell-84-2.png"/>
<p>Figur 84-1 viser prinsippet.</p>
<graphic xlink:href="figur-84-1.png"/>
</sec>
</sec>
</body>
</standard>

View file

@ -1,14 +0,0 @@
<!doctype html>
<html><head><title>Kapittel 84</title></head>
<body>
<h1>84 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 84-2.</p>
<img src="graphics/tabell-84-2.png" alt="Tabell 84-2 Hevetidsklasser">
<p>Figuren under viser prinsippet.</p>
<figure>
<img src="graphics/figur-84-1.png" alt="Figur 84-1 Prinsippskisse">
<figcaption>Figur 84-1 Prinsippskisse</figcaption>
</figure>
<p>Og en som ligger et annet sted:</p>
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
</body></html>

View file

@ -1,3 +1,3 @@
Post,Mengde,Enhet
84.1,120,m3
84.2,45,m2
7.1,120,m3
7.2,45,m2

1 Post Mengde Enhet
2 84.1 7.1 120 m3
3 84.2 7.2 45 m2

View file

@ -11,7 +11,7 @@ Vask skjer to ganger i året.
| Øverst | 6 mnd |
| Nederst | 12 mnd |
![Figur 1 Vaskeplan](graphics/tabell-84-2.png)
![Figur 1 Vaskeplan](graphics/tabell-7-2.png)
```bash
# ikke en overskrift

View file

@ -3,7 +3,7 @@
<body>
<h1>Ovnen</h1>
<p>Steketemperaturen er 145 grader.</p>
<img src="graphics/tabell-84-2.png" alt="Hyllekart">
<img src="graphics/tabell-7-2.png" alt="Hyllekart">
<h2>Hyller</h2>
<ul><li>Øverst</li><li>Nederst</li></ul>
<table><tr><th>Hylle</th><th>Temperatur</th></tr><tr><td>Øverst</td><td>180 C</td></tr></table>

View file

@ -1,11 +1,11 @@
<standard>
<front><std-ident><doc-number>P762</doc-number><year>2025</year></std-ident></front>
<front><std-ident><doc-number>P351</doc-number><year>2025</year></std-ident></front>
<body>
<sec><label>85</label><title>Bakeplater</title>
<p>Platen skal ha jevn varme etter <mixed-citation>EKS 1234-1:2030</mixed-citation>.</p>
<p>Kravet regnes som <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>T</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>2</mml:mn></mml:math>.</p>
<fig><label>Figur 85-1</label><caption><p>Maalepunkter langs bakeplaten.</p></caption>
<graphic xlink:href="figur-84-1.png" xmlns:xlink="http://www.w3.org/1999/xlink"/></fig>
<graphic xlink:href="figur-7-1.png" xmlns:xlink="http://www.w3.org/1999/xlink"/></fig>
<table-wrap><label>Tabell 85-1</label>
<table><tr><th>Klasse</th><th>T</th></tr><tr><td>1</td><td>1,5</td></tr></table>
</table-wrap>

View file

@ -22,7 +22,7 @@
],
"paragraph": [
[
"Figur 84-1 viser prinsippet."
"Figur 7-1 viser prinsippet."
],
[]
],
@ -42,8 +42,8 @@
"images": [
{
"kind": "local",
"ref": "graphics/figur-84-1.png",
"target": "graphics/figur-84-1.png"
"ref": "graphics/figur-7-1.png",
"target": "graphics/figur-7-1.png"
}
],
"suffix": ".html",
@ -64,7 +64,7 @@
],
"heading": [
[
"Figur 84-1"
"Figur 7-1"
]
],
"image": [
@ -94,7 +94,7 @@
},
"witness": "html.parser"
},
"kapittel-84-notat.docx": {
"kapittel-7-notat.docx": {
"elements": {
"cell": 0,
"comment": 0,
@ -127,7 +127,7 @@
],
"paragraph": [
[
"Hevetidsklasse er gitt i tabell 84-2."
"Hevetidsklasse er gitt i tabell 7-2."
],
[
"Etter tabellen kommer steketidene."
@ -138,7 +138,7 @@
},
"witness": "docx zip xml"
},
"kapittel-84-presentasjon.pptx": {
"kapittel-7-presentasjon.pptx": {
"elements": {
"cell": 0,
"hidden_slide": 0,
@ -179,7 +179,7 @@
},
"witness": "pptx zip xml"
},
"kapittel-84-sts.xml": {
"kapittel-7-sts.xml": {
"elements": {
"cell": 0,
"citation": 0,
@ -199,13 +199,13 @@
"images": [
{
"kind": "local",
"ref": "graphics/tabell-84-2.png",
"target": "graphics/tabell-84-2.png"
"ref": "graphics/tabell-7-2.png",
"target": "graphics/tabell-7-2.png"
},
{
"kind": "local",
"ref": "figur-84-1.png",
"target": "graphics/figur-84-1.png"
"ref": "figur-7-1.png",
"target": "graphics/figur-7-1.png"
}
],
"suffix": ".xml",
@ -223,34 +223,34 @@
"math": [],
"paragraph": [
[
"Hevetidsklasse er gitt i tabell 84-2."
"Hevetidsklasse er gitt i tabell 7-2."
],
[
"Figur 84-1 viser prinsippet."
"Figur 7-1 viser prinsippet."
]
],
"section": [
[
"84.1",
"7.1",
"Hevetider",
"Hevetidsklasse er gitt i tabell 84-2.",
"Figur 84-1 viser prinsippet."
"Hevetidsklasse er gitt i tabell 7-2.",
"Figur 7-1 viser prinsippet."
],
[
"84",
"7",
"Brød og boller",
"84.1",
"7.1",
"Hevetider",
"Hevetidsklasse er gitt i tabell 84-2.",
"Figur 84-1 viser prinsippet."
"Hevetidsklasse er gitt i tabell 7-2.",
"Figur 7-1 viser prinsippet."
]
],
"section_label": [
[
"84"
"7"
],
[
"84.1"
"7.1"
]
],
"table": [],
@ -266,7 +266,7 @@
},
"witness": "xml.etree"
},
"kapittel-84-tabell.pdf": {
"kapittel-7-tabell.pdf": {
"elements": {
"image": 2,
"page": 1
@ -291,13 +291,13 @@
],
"page": [
[
"Hevetidsklasse er gitt i tabell 84-2"
"Hevetidsklasse er gitt i tabell 7-2"
]
]
},
"witness": "pdfplumber objects"
},
"kapittel-84-web.html": {
"kapittel-7-web.html": {
"elements": {
"cell": 0,
"heading": 1,
@ -309,13 +309,13 @@
"images": [
{
"kind": "local",
"ref": "graphics/tabell-84-2.png",
"target": "graphics/tabell-84-2.png"
"ref": "graphics/tabell-7-2.png",
"target": "graphics/tabell-7-2.png"
},
{
"kind": "local",
"ref": "graphics/figur-84-1.png",
"target": "graphics/figur-84-1.png"
"ref": "graphics/figur-7-1.png",
"target": "graphics/figur-7-1.png"
},
{
"kind": "remote",
@ -328,7 +328,7 @@
"cell": [],
"heading": [
[
"84 Brød og boller"
"7 Brød og boller"
]
],
"image": [
@ -339,7 +339,7 @@
"list_item": [],
"paragraph": [
[
"Hevetidsklasse for de enkelte deigtyper er gitt i tabell 84-2."
"Hevetidsklasse for de enkelte deigtyper er gitt i tabell 7-2."
],
[
"Figuren under viser prinsippet."
@ -1047,7 +1047,7 @@
"texts": {
"cell": [
[
"84.1"
"7.1"
],
[
"120"
@ -1056,7 +1056,7 @@
"m3"
],
[
"84.2"
"7.2"
],
[
"45"
@ -1078,12 +1078,12 @@
],
"row": [
[
"84.1",
"7.1",
"120",
"m3"
],
[
"84.2",
"7.2",
"45",
"m2"
]
@ -1103,8 +1103,8 @@
"images": [
{
"kind": "local",
"ref": "graphics/tabell-84-2.png",
"target": "graphics/tabell-84-2.png"
"ref": "graphics/tabell-7-2.png",
"target": "graphics/tabell-7-2.png"
}
],
"suffix": ".md",
@ -1170,13 +1170,13 @@
"Post"
],
[
"84.1"
"7.1"
],
[
"Post"
],
[
"84.1"
"7.1"
]
],
"hidden_slide": [
@ -1184,7 +1184,7 @@
"Utgaatt lysbilde",
"Ikke vis dette.",
"Post",
"84.1"
"7.1"
]
],
"image": [],
@ -1203,25 +1203,25 @@
],
"slide": [
[
"Kapittel 84 Boller",
"Kapittel 7 Boller",
"Hevetider er gitt i tabell.",
"Post",
"84.1"
"7.1"
]
],
"table": [
[
"Post",
"84.1"
"7.1"
],
[
"Post",
"84.1"
"7.1"
]
],
"title": [
[
"Kapittel 84 Boller"
"Kapittel 7 Boller"
],
[
"Utgaatt lysbilde"
@ -1429,8 +1429,8 @@
"images": [
{
"kind": "local",
"ref": "graphics/tabell-84-2.png",
"target": "graphics/tabell-84-2.png"
"ref": "graphics/tabell-7-2.png",
"target": "graphics/tabell-7-2.png"
}
],
"suffix": ".htm",
@ -1586,8 +1586,8 @@
"images": [
{
"kind": "local",
"ref": "figur-84-1.png",
"target": "graphics/figur-84-1.png"
"ref": "figur-7-1.png",
"target": "graphics/figur-7-1.png"
}
],
"suffix": ".xml",
@ -1795,18 +1795,18 @@
}
},
"files": {
"graphics/figur-84-1.png": {
"graphics/figur-7-1.png": {
"pointed_at_by": [
"figur.html",
"kapittel-84-sts.xml",
"kapittel-84-web.html",
"kapittel-7-sts.xml",
"kapittel-7-web.html",
"sts-rikt.xml"
]
},
"graphics/tabell-84-2.png": {
"graphics/tabell-7-2.png": {
"pointed_at_by": [
"kapittel-84-sts.xml",
"kapittel-84-web.html",
"kapittel-7-sts.xml",
"kapittel-7-web.html",
"notat.md",
"side.htm"
]

View file

@ -124,7 +124,7 @@ def _slide(title: str, body: str, *, hidden: bool = False) -> str:
+ 'uri="http://schemas.openxmlformats.org/drawingml/2006/table">'
+ "<a:tbl><a:tr>"
+ "<a:tc><a:txBody><a:p><a:r><a:t>Post</a:t></a:r></a:p></a:txBody></a:tc>"
+ "<a:tc><a:txBody><a:p><a:r><a:t>84.1</a:t></a:r></a:p></a:txBody></a:tc>"
+ "<a:tc><a:txBody><a:p><a:r><a:t>7.1</a:t></a:r></a:p></a:txBody></a:tc>"
+ "</a:tr></a:tbl></a:graphicData></a:graphic></p:graphicFrame>"
+ "</p:spTree></p:cSld></p:sld>"
)
@ -164,7 +164,7 @@ _PPTX_PARTS: dict[str, str | bytes] = {
+ f"<p:presentation {_P}><p:sldIdLst>"
+ '<p:sldId id="256" r:id="rId1"/><p:sldId id="257" r:id="rId2"/>'
+ "</p:sldIdLst></p:presentation>",
"ppt/slides/slide1.xml": _slide("Kapittel 84 Boller", "Hevetider er gitt i tabell."),
"ppt/slides/slide1.xml": _slide("Kapittel 7 Boller", "Hevetider er gitt i tabell."),
"ppt/slides/slide2.xml": _slide("Utgaatt lysbilde", "Ikke vis dette.", hidden=True),
"ppt/notesSlides/notesSlide1.xml": _XML
+ f"<p:notes {_P} {_A}><p:cSld><p:spTree><p:sp><p:txBody>"
@ -272,7 +272,7 @@ _ODT_PARTS: dict[str, str | bytes] = {
+ "<text:list><text:list-item><text:p>Kant</text:p></text:list-item>"
+ "<text:list-item><text:p>Flate</text:p></text:list-item></text:list>"
+ "<text:p>Se figuren under."
+ '<draw:frame><draw:image xlink:href="graphics/figur-84-1.png"/></draw:frame></text:p>'
+ '<draw:frame><draw:image xlink:href="graphics/figur-7-1.png"/></draw:frame></text:p>'
+ "<office:annotation><text:p>Sjekk denne mot Q400 foer utsendelse.</text:p>"
+ "</office:annotation>"
+ "<table:table><table:table-row>"
@ -294,7 +294,7 @@ _ODT_PARTS: dict[str, str | bytes] = {
_RTF = (
r"{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}}"
r"\pard Figur 84-1 viser prinsippet.\par"
r"\pard Figur 7-1 viser prinsippet.\par"
r"\pard{\pict\pngblip\picw16\pich16 89504e470d0a1a0a}\par"
"}"
)
@ -304,11 +304,11 @@ _RTF = (
_HTML = """<!DOCTYPE html>
<html lang="no">
<head><title>Figur 84-1</title></head>
<head><title>Figur 7-1</title></head>
<body>
<h1>Figur 84-1</h1>
<h1>Figur 7-1</h1>
<p>Prinsippet for hevetidsklasser.</p>
<img src="graphics/figur-84-1.png" alt="Prinsippskisse">
<img src="graphics/figur-7-1.png" alt="Prinsippskisse">
<table><tr><th>Klasse</th><th>Avvik</th></tr><tr><td>A</td><td>5 min</td></tr></table>
<ul><li>Klasse A</li><li>Klasse B</li></ul>
</body>
@ -319,13 +319,13 @@ _HTML = """<!DOCTYPE html>
# --- sts: a citation, a formula, a figure with a caption, a table, a footnote -
_STS = """<standard>
<front><std-ident><doc-number>P762</doc-number><year>2025</year></std-ident></front>
<front><std-ident><doc-number>P351</doc-number><year>2025</year></std-ident></front>
<body>
<sec><label>85</label><title>Bakeplater</title>
<p>Platen skal ha jevn varme etter <mixed-citation>EKS 1234-1:2030</mixed-citation>.</p>
<p>Kravet regnes som <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>T</mml:mi><mml:mo>&lt;</mml:mo><mml:mn>2</mml:mn></mml:math>.</p>
<fig><label>Figur 85-1</label><caption><p>Maalepunkter langs bakeplaten.</p></caption>
<graphic xlink:href="figur-84-1.png" xmlns:xlink="http://www.w3.org/1999/xlink"/></fig>
<graphic xlink:href="figur-7-1.png" xmlns:xlink="http://www.w3.org/1999/xlink"/></fig>
<table-wrap><label>Tabell 85-1</label>
<table><tr><th>Klasse</th><th>T</th></tr><tr><td>1</td><td>1,5</td></tr></table>
</table-wrap>

View file

Before

Width:  |  Height:  |  Size: 94 B

After

Width:  |  Height:  |  Size: 94 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 122 B

Before After
Before After

Binary file not shown.

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
<front><std-ident><doc-number>P350</doc-number></std-ident></front>
<body>
<sec>
<label>7</label>
<title>Brød og boller</title>
<sec>
<label>7.1</label>
<title>Hevetider</title>
<p>Hevetidsklasse er gitt i tabell 7-2.</p>
<graphic xlink:href="graphics/tabell-7-2.png"/>
<p>Figur 7-1 viser prinsippet.</p>
<graphic xlink:href="figur-7-1.png"/>
</sec>
</sec>
</body>
</standard>

View file

@ -0,0 +1,14 @@
<!doctype html>
<html><head><title>Kapittel 7</title></head>
<body>
<h1>7 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 7-2.</p>
<img src="graphics/tabell-7-2.png" alt="Tabell 7-2 Hevetidsklasser">
<p>Figuren under viser prinsippet.</p>
<figure>
<img src="graphics/figur-7-1.png" alt="Figur 7-1 Prinsippskisse">
<figcaption>Figur 7-1 Prinsippskisse</figcaption>
</figure>
<p>Og en som ligger et annet sted:</p>
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
</body></html>

Binary file not shown.

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
<front><std-ident><doc-number>P761</doc-number></std-ident></front>
<body>
<sec>
<label>84</label>
<title>Brød og boller</title>
<sec>
<label>84.1</label>
<title>Hevetider</title>
<p>Hevetidsklasse er gitt i tabell 84-2.</p>
<graphic xlink:href="graphics/tabell-84-2.png"/>
<p>Figur 84-1 viser prinsippet.</p>
<graphic xlink:href="figur-84-1.png"/>
</sec>
</sec>
</body>
</standard>

View file

@ -1,14 +0,0 @@
<!doctype html>
<html><head><title>Kapittel 84</title></head>
<body>
<h1>84 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 84-2.</p>
<img src="graphics/tabell-84-2.png" alt="Tabell 84-2 Hevetidsklasser">
<p>Figuren under viser prinsippet.</p>
<figure>
<img src="graphics/figur-84-1.png" alt="Figur 84-1 Prinsippskisse">
<figcaption>Figur 84-1 Prinsippskisse</figcaption>
</figure>
<p>Og en som ligger et annet sted:</p>
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
</body></html>

View file

@ -113,19 +113,19 @@ OUTLINED_TREE = (
)
#: TWO bookmarks whose destinations resolve to the SAME line, mirroring what a
#: 701-page reference standard carries: its tree's root node and its front-matter
#: node both land on line 0. Measured on that document, 2 763 nodes
#: entered the bridge and 2 762 marks came out with `unresolved` at 0 -- the
#: difference was a dict keyed on the line index, dropping the second node with
#: nothing counting it. A one-bookmark-per-line fixture cannot see that.
#: long reference standard carries: its tree's root node and its front-matter
#: node both land on line 0. Measured on that document, N + 2 nodes (N its
#: declared sections) entered the bridge and N + 1 marks came out with
#: `unresolved` at 0 -- the difference was a dict keyed on the line index,
#: dropping the second node with nothing counting it. A one-bookmark-per-line fixture cannot see that.
COLLISION_CONTENTS = (
b"BT /F1 12 Tf 20 170 Td (P761 Oppskriftsboka) Tj ET\n"
b"BT /F1 12 Tf 20 170 Td (P350 Oppskriftsboka) Tj ET\n"
b"BT /F1 12 Tf 20 150 Td (Innledende tekst om grunnlaget.) Tj ET\n",
)
#: Both point at `/XYZ 20 185`, which is above the page's first line.
COLLISION_TREE = (
("P761 Oppskriftsboka", 1, 0, 185),
("P350 Oppskriftsboka", 1, 0, 185),
("EKS - Forside", 2, 0, 185),
)

View file

@ -88,7 +88,7 @@ PDF_GRAY_SAMPLES = bytes([0, 60, 120, 180, 20, 80, 140, 200, 40, 100, 160, 255])
PDF_JPEG_WIDTH, PDF_JPEG_HEIGHT = 360, 269
PDF_CONTENT = (
b"BT /F1 12 Tf 20 170 Td (Hevetidsklasse er gitt i tabell 84-2) Tj ET\n"
b"BT /F1 12 Tf 20 170 Td (Hevetidsklasse er gitt i tabell 7-2) Tj ET\n"
b"q 80 0 0 60 20 90 cm /ImFlate Do Q\n"
b"q 80 0 0 60 20 20 cm /ImJpeg Do Q\n"
)
@ -153,15 +153,15 @@ def build_image_pdf() -> bytes:
# the gate counts it as found-and-not-carried rather than as absent.
HTML_DOCUMENT = """<!doctype html>
<html><head><title>Kapittel 84</title></head>
<html><head><title>Kapittel 7</title></head>
<body>
<h1>84 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 84-2.</p>
<img src="graphics/tabell-84-2.png" alt="Tabell 84-2 Hevetidsklasser">
<h1>7 Brød og boller</h1>
<p>Hevetidsklasse for de enkelte deigtyper er gitt i tabell 7-2.</p>
<img src="graphics/tabell-7-2.png" alt="Tabell 7-2 Hevetidsklasser">
<p>Figuren under viser prinsippet.</p>
<figure>
<img src="graphics/figur-84-1.png" alt="Figur 84-1 Prinsippskisse">
<figcaption>Figur 84-1 Prinsippskisse</figcaption>
<img src="graphics/figur-7-1.png" alt="Figur 7-1 Prinsippskisse">
<figcaption>Figur 7-1 Prinsippskisse</figcaption>
</figure>
<p>Og en som ligger et annet sted:</p>
<img src="https://example.invalid/ekstern.png" alt="Ekstern figur">
@ -178,18 +178,18 @@ HTML_DOCUMENT = """<!doctype html>
STS_DOCUMENT = """<?xml version="1.0" encoding="UTF-8"?>
<standard xmlns:xlink="http://www.w3.org/1999/xlink">
<front><std-ident><doc-number>P761</doc-number></std-ident></front>
<front><std-ident><doc-number>P350</doc-number></std-ident></front>
<body>
<sec>
<label>84</label>
<label>7</label>
<title>Brød og boller</title>
<sec>
<label>84.1</label>
<label>7.1</label>
<title>Hevetider</title>
<p>Hevetidsklasse er gitt i tabell 84-2.</p>
<graphic xlink:href="graphics/tabell-84-2.png"/>
<p>Figur 84-1 viser prinsippet.</p>
<graphic xlink:href="figur-84-1.png"/>
<p>Hevetidsklasse er gitt i tabell 7-2.</p>
<graphic xlink:href="graphics/tabell-7-2.png"/>
<p>Figur 7-1 viser prinsippet.</p>
<graphic xlink:href="figur-7-1.png"/>
</sec>
</sec>
</body>
@ -217,20 +217,20 @@ def build_docx() -> bytes:
"word/_rels/document.xml.rels": _XML
+ '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'
+ '<Relationship Id="rIdImg" Type="http://schemas.openxmlformats.org/officeDocument'
+ '/2006/relationships/image" Target="media/tabell-84-2.png"/></Relationships>',
"word/media/tabell-84-2.png": image,
+ '/2006/relationships/image" Target="media/tabell-7-2.png"/></Relationships>',
"word/media/tabell-7-2.png": image,
"word/document.xml": _XML
+ '<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"'
+ ' xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"'
+ ' xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"'
+ ' xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"'
+ ' xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><w:body>'
+ "<w:p><w:r><w:t>Hevetidsklasse er gitt i tabell 84-2.</w:t></w:r></w:p>"
+ "<w:p><w:r><w:t>Hevetidsklasse er gitt i tabell 7-2.</w:t></w:r></w:p>"
+ '<w:p><w:r><w:drawing><wp:inline><wp:extent cx="381000" cy="285750"/>'
+ '<wp:docPr id="1" name="Bilde 1" descr="Tabell 84-2 Hevetidsklasser"/>'
+ '<wp:docPr id="1" name="Bilde 1" descr="Tabell 7-2 Hevetidsklasser"/>'
+ '<a:graphic><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006'
+ '/picture"><pic:pic><pic:nvPicPr><pic:cNvPr id="1" name="tabell-84-2.png"'
+ ' descr="Tabell 84-2 Hevetidsklasser"/><pic:cNvPicPr/></pic:nvPicPr>'
+ '/picture"><pic:pic><pic:nvPicPr><pic:cNvPr id="1" name="tabell-7-2.png"'
+ ' descr="Tabell 7-2 Hevetidsklasser"/><pic:cNvPicPr/></pic:nvPicPr>'
+ '<pic:blipFill><a:blip r:embed="rIdImg"/><a:stretch><a:fillRect/></a:stretch>'
+ '</pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/>'
+ '<a:ext cx="381000" cy="285750"/></a:xfrm>'
@ -310,17 +310,17 @@ if __name__ == "__main__":
# FIVE DISTINCT STEMS. One stem across five extensions is refused by the
# door's own SS 3 collision rule -- measured while building this fixture:
# `kapittel-84.{pdf,docx,pptx}` gave `inbox_slug_collision: 2/7` and two of
# `kapittel-7.{pdf,docx,pptx}` gave `inbox_slug_collision: 2/7` and two of
# the five readers were never exercised at all, with the gate reporting a
# carrying defect that was really a fixture defect.
written: list[tuple[str, bytes]] = [
("graphics/tabell-84-2.png", png(120, 90, value=0x20)),
("graphics/figur-84-1.png", png(64, 48, value=0x80)),
("kapittel-84-web.html", HTML_DOCUMENT.encode("utf-8")),
("kapittel-84-sts.xml", STS_DOCUMENT.encode("utf-8")),
("kapittel-84-tabell.pdf", build_image_pdf()),
("kapittel-84-notat.docx", build_docx()),
("kapittel-84-presentasjon.pptx", build_pptx()),
("graphics/tabell-7-2.png", png(120, 90, value=0x20)),
("graphics/figur-7-1.png", png(64, 48, value=0x80)),
("kapittel-7-web.html", HTML_DOCUMENT.encode("utf-8")),
("kapittel-7-sts.xml", STS_DOCUMENT.encode("utf-8")),
("kapittel-7-tabell.pdf", build_image_pdf()),
("kapittel-7-notat.docx", build_docx()),
("kapittel-7-presentasjon.pptx", build_pptx()),
]
for name, payload in written:
(IMAGES / name).write_bytes(payload)

View file

@ -11,7 +11,7 @@ endobj
4 0 obj
<< /Length 114 >>
stream
BT /F1 12 Tf 20 170 Td (P761 Oppskriftsboka) Tj ET
BT /F1 12 Tf 20 170 Td (P350 Oppskriftsboka) Tj ET
BT /F1 12 Tf 20 150 Td (Innledende tekst om grunnlaget.) Tj ET
endstream
endobj
@ -22,7 +22,7 @@ endobj
<< /Type /Outlines /First 7 0 R /Last 7 0 R /Count 2 >>
endobj
7 0 obj
<< /Title (P761 Oppskriftsboka) /Parent 6 0 R /First 8 0 R /Last 8 0 R /Count 1 /Dest [3 0 R /XYZ 20 185 0] >>
<< /Title (P350 Oppskriftsboka) /Parent 6 0 R /First 8 0 R /Last 8 0 R /Count 1 /Dest [3 0 R /XYZ 20 185 0] >>
endobj
8 0 obj
<< /Title (EKS - Forside) /Parent 7 0 R /Dest [3 0 R /XYZ 20 185 0] >>

View file

@ -1,8 +1,8 @@
<standard>
<body>
<sec id="s-1">
<label>84.61</label>
<title>Beskyttelse av betong</title>
<label>14.61</label>
<title>Beskyttelse av benkeplate</title>
<sec id="s-1-a" sec-type="spec">
<label>a)</label>
<p>Omfatter beskyttelse mot kjemikalier.</p>
@ -12,8 +12,8 @@
</sec>
</sec>
<sec id="s-2">
<label>84.62</label>
<title>Rengjoering av betongoverflate</title>
<label>14.62</label>
<title>Rengjoering av benkeflate</title>
<p>Overflaten rengjoeres foer behandling.</p>
</sec>
</body>

View file

@ -8,31 +8,31 @@
</std-doc-meta>
</front>
<body>
<sec id="s-88" sec-type="procedure">
<label>88</label>
<title>Gelender</title>
<sec id="s-88-612" sec-type="procedure">
<label>88.612</label>
<title>Utskifting av enkeltkomponenter</title>
<sec id="s-88-612-a" sec-type="spec">
<sec id="s-17" sec-type="procedure">
<label>17</label>
<title>Kjokkenbenk</title>
<sec id="s-17-612" sec-type="procedure">
<label>17.612</label>
<title>Utskifting av enkeltdeler</title>
<sec id="s-17-612-a" sec-type="spec">
<label>a)</label>
<p>Omfatter utskifting av skadde enkeltkomponenter i gelender.</p>
<p>Omfatter utskifting av skadde enkeltdeler i kjokkenbenk.</p>
</sec>
<sec id="s-88-612-b" sec-type="spec">
<sec id="s-17-612-b" sec-type="spec">
<label>b)</label>
<p>Et andre punkt blir aldri beskrivelsen.</p>
</sec>
<sec id="s-88-6121" sec-type="procedure">
<label>88.6121</label>
<title><italic>Utskifting av handlist</italic></title>
<sec id="s-17-6121" sec-type="procedure">
<label>17.6121</label>
<title><italic>Utskifting av handtak</italic></title>
</sec>
</sec>
<sec id="s-88-613" sec-type="procedure">
<label>88.613</label>
<title>Maling av gelender</title>
<sec id="s-88-613-a" sec-type="spec">
<sec id="s-17-613" sec-type="procedure">
<label>17.613</label>
<title>Maling av kjokkenbenk</title>
<sec id="s-17-613-a" sec-type="spec">
<label>a)</label>
<p>Omfatter maling av gelender.</p>
<p>Omfatter maling av kjokkenbenk.</p>
<p>Et andre avsnitt i samme punkt blir ikke med.</p>
</sec>
</sec>

View file

@ -8,12 +8,12 @@
<body>
<sec sec-type="procedure" id="s7"><label>7</label><title>Vedlikehold av utstyr</title>
<sec sec-type="spec"><label>a)</label><p>Omfatter vedlikehold av alt utstyr i kjøkkenet.</p></sec>
<sec sec-type="procedure" id="s7-6"><label>7.6</label><title>Gelender</title>
<sec sec-type="procedure" id="s7-6"><label>7.6</label><title>Kjokkenbenk</title>
<sec sec-type="procedure" id="s7-61"><label>7.61</label><title>Utskifting</title>
<sec sec-type="procedure" id="s7-612"><label>7.612</label><title>Utskifting av enkeltdeler</title>
<sec sec-type="spec"><label>a)</label><p>Omfatter utskifting av skadde enkeltdeler i gelender.</p></sec>
<sec sec-type="spec"><label>a)</label><p>Omfatter utskifting av skadde enkeltdeler i kjokkenbenk.</p></sec>
<sec sec-type="procedure" id="s7-6121"><label>7.6121</label><title>Utskifting av list</title></sec>
<sec sec-type="procedure" id="s7-6122"><label>7.6122</label><title>Utskifting av stolpe</title></sec>
<sec sec-type="procedure" id="s7-6122"><label>7.6122</label><title>Utskifting av hengsel</title></sec>
</sec>
</sec>
</sec>