Commit Graph
4 Commits
Author SHA1 Message Date
aiongg b34a8cdbed feat: read the attributes of XML elements
The 22 bytes after tag and content in node part 0xBF0D end with an
attribute count; each attribute is a name, a u16 and a value as text.
Nodes with attributes made their story's XML structure unreadable
("XML node of unknown layout", 108 stories in 30 pairs). The converter
writes them as XMLAttribute elements, which equal the IDML's in every
pair with attributes.

compare.py (trustworthy pairs): 213 XMLAttribute and 240 XMLElement
values more; the stale pairs gain 12,247 attributes.
2026-10-10 07:24:49 +00:00
aiongg 261e378d07 feat: write notes, page references, tracked changes and hidden XML markers
- Notes (class 0xA429): their text and a Note element in place of the
  U+FEFF, with dates by the link time rule, user name and document user.
- Index markers (class 0x13006): a PageReference with Self and Id in
  place of the U+FEFF (topics are not written yet).
- Tracked changes: deleted text (class 0xA40A) as Change DeletedText
  before the following character; inserted runs (strand run kind
  0xA466) wrapped in Change InsertedText inside each character range,
  closed at tables, anchored items and XML markers.
- XML markers are left out of the text when the node store cannot be
  read.
- Character-level sources open before an element character (note,
  destination), apart from paragraph destinations, which the schema
  does not allow in them.

Trustworthy pairs: reproduced 10,772,444 -> 11,266,452 (92.60 % ->
96.85 %); stories with identical text 18,574 -> 18,602 of 18,610;
PageReference 7,523 with Id; 1,709 more hyperlink sources and
hyperlinks (in deleted text). Notes 211 of 211 and changes 6,024 of
6,027 match the reference attributes (multisets per pair, no Self).
Extra values 26,107 -> 26,333: 220 from Change elements written inside
sources where InDesign writes an empty Change before them, 9 from
PageReference. HyperlinkTextSource/Note loses 3 elements for the same
reason (the source's first child is now the Change). Schema
validation: 0 failures.
2026-10-08 04:15:15 +00:00
aiongg 1d0e27db32 feat: convert big-endian files from InDesign 3.0 and 4.0
The byte order flag applies to object data only: database pages stay
little-endian. Object data is decoded in the file's byte order, and in
big-endian data the string tag and the flag byte before it are swapped.

The two big-endian samples are also the only files from before
InDesign 7.0, and some of their layouts differ: page transform and
bounds chunks, font records, XML tag names and nodes, story strands and
40-byte guide records are read; text frame settings, document
preferences, a composite font and a section style are left out with a
warning. The 40-byte guides of an InDesign 7.0 file are now read too.

docs/format/big-endian.md records the evidence. The corpus tests now
cover all byte orders.
2026-10-07 03:11:04 +00:00
aiongg 496c3e5d65 feat: convert the XML structure
Read the XML nodes stored with each story, place their markers in the
story text and write the backing story as XmlStory, with the elements
in it and in the stories they tag. Element Self names follow the node
IDs from the root down. The backing story is added to StoryList.
2026-10-07 02:42:17 +00:00