Skip to content

feat(ris): read Austrian RIS legal XML (risdok) - #907

Merged
artiz merged 1 commit into
docling-project:masterfrom
artiz:claude/ris-xml-902
Oct 28, 2026
Merged

artiz merged 1 commit into
docling-project:masterfrom
artiz:claude/ris-xml-902

Conversation

@artiz

@artiz artiz commented Oct 28, 2026

Copy link
Copy Markdown
Member

A RIS document (the Rechtsinformationssystem's open-data risdok, namespace http://www.bka.gv.at) had no semantic reading: a bare .xml came out as one xml code block of raw markup (before #671, empty from the JATS reader). docling has no RIS backend, so this is a docling.rs extension.

backend/ris.rs reads the markup in source order, one section group per abschnitt (named abschnitt {nr}) so every item keeps where it came from:

  • ueberschrift -> section header (titel/g1 level 1, g2..g4 deeper)
  • absatz -> paragraph, b/i/u/sup/sub runs kept as an inline group, feld/span read as text, tab as a space
  • a bullet absatz (a glyph, Word's Symbol-font U+F0B7 included, or none in a hanging indent, before its first tab) -> list item; numbered paragraphs stay paragraphs
  • table -> table, spans honoured, Word's zero-height row dropped
  • kzinhalt/fzinhalt -> page_header/page_footer furniture
  • metadaten, layoutdaten, abstand skipped JSON, HTML and DocLang come from the item tree (DocLang through the tree serializer); docling-core 2.104 loads the JSON and writes the same DocLang from it.

The Markdown escapes * too: RIS pseudonymizes with stars (A*** GmbH, FN *0*271*h) that would otherwise become emphasis; the plain-text export now reads \* as a star and never closes an emphasis span on one.

Routed by the xml route's dialect sniff (a <risdok> root) and the xml_ris format id (CLI, Python, Node). The issue's public decision (DSBT_20250904_2025_0_699_550_00.xml, RIS open data) is the regression fixture.

Closes #902

Claude-Session: https://claude.ai/code/session_01DaTwMqag3st8G7PT7cPrLc

A RIS document (the Rechtsinformationssystem's open-data `risdok`,
namespace http://www.bka.gv.at) had no semantic reading: a bare .xml
came out as one `xml` code block of raw markup (before docling-project#671, empty
from the JATS reader). docling has no RIS backend, so this is a
docling.rs extension.

backend/ris.rs reads the markup in source order, one `section` group
per `abschnitt` (named `abschnitt {nr}`) so every item keeps where it
came from:
- `ueberschrift` -> section header (titel/g1 level 1, g2..g4 deeper)
- `absatz` -> paragraph, b/i/u/sup/sub runs kept as an inline group,
  `feld`/`span` read as text, `tab` as a space
- a bullet `absatz` (a glyph, Word's Symbol-font U+F0B7 included, or
  none in a hanging indent, before its first `tab`) -> list item;
  numbered paragraphs stay paragraphs
- `table` -> table, spans honoured, Word's zero-height row dropped
- `kzinhalt`/`fzinhalt` -> page_header/page_footer furniture
- metadaten, layoutdaten, abstand skipped
JSON, HTML and DocLang come from the item tree (DocLang through the
tree serializer); docling-core 2.104 loads the JSON and writes the
same DocLang from it.

The Markdown escapes `*` too: RIS pseudonymizes with stars
(`A*** GmbH`, `FN *0*271*h`) that would otherwise become emphasis;
the plain-text export now reads `\*` as a star and never closes an
emphasis span on one.

Routed by the `xml` route's dialect sniff (a `<risdok>` root) and the
`xml_ris` format id (CLI, Python, Node). The issue's public decision
(DSBT_20250904_2025_0_699_550_00.xml, RIS open data) is the
regression fixture.

Closes docling-project#902

Signed-off-by: artiz <artem.kustikov@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaTwMqag3st8G7PT7cPrLc
@artiz
artiz merged commit dea3e96 into docling-project:master Oct 28, 2026
13 checks passed
@artiz
artiz deleted the claude/ris-xml-902 branch October 28, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RIS legal XML: semantic heading/paragraph reading is unavailable (unknown XML becomes one code block)

1 participant