Skip to content

locate the original source of DCLX archives by relationship - #239

Merged
vagenas merged 1 commit into
archive-validationfrom
archive-source-relationship
Nov 19, 2026
Merged

vagenas merged 1 commit into
archive-validationfrom
archive-source-relationship

Conversation

@vagenas

@vagenas vagenas commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Locate the original source of a DCLX archive by a package relationship instead of a fixed part name.

Spec (Annex B)

  • The source is the part targeted by the _rels/.rels relationship http://doclang.ai/ns/package/2026/relationships/source. It must be internal and have a content type.
  • Recommended placement: /source.<ext> (up to two extensions, e.g. /source.tar.gz), /source, or an existing part (e.g. audio/1.mp3) with no second copy.
  • Optional source descriptor (…/source-metadata relationship, application/vnd.doclang.source-metadata+xml) recording the original file name, allowed only together with the source.

Packer

  • --source FILE stores the original as source.<ext>, or reuses the part if the same file is already packed (e.g. as --audio).
  • --keep-source-name records the file's own name; --source-name NAME records another one (mutually exclusive).
  • Content types: built-in defaults now include pdf, Office formats and svg; [Content_Types].xml declares only the extensions actually present.
  • Python API: pack(..., source=..., source_name=...).

Validator

  • For documents of version 0.10 or later (or declaring none), the archive check covers the source: its relationship targets an existing part of the archive, there is at most one source and one descriptor relationship, and the descriptor has a source root element in its namespace and comes with a source. The source's content type is checked with that of every other part.

Migration

  • Package relationships and overrides follow renamed whole-track media. Media of a removed track that a relationship targets (e.g. as the source) is moved to source.<ext> instead of being dropped.

@vagenas
vagenas force-pushed the archive-source-relationship branch 2 times, most recently from a7029a7 to 55de252 Compare November 19, 2026 10:46
@vagenas
vagenas changed the base branch from main to archive-validation November 19, 2026 12:11
@vagenas
vagenas added this pull request to stack #242 November 19, 2026 12:12
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
@vagenas
vagenas force-pushed the archive-source-relationship branch from 55de252 to dbbaf6b Compare November 19, 2026 13:28
@vagenas
vagenas marked this pull request as ready for review November 19, 2026 13:31

@dolfim-ibm dolfim-ibm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vagenas
vagenas merged commit 6a938a5 into main Nov 19, 2026
10 checks passed
@vagenas
vagenas deleted the archive-source-relationship branch November 19, 2026 13:41
@vagenas vagenas mentioned this pull request Nov 19, 2026
2 tasks
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.

3 participants