IDML Reference / Package anatomy
How the parts reference each other
An IDML package becomes one document through id references — an attribute names the Self id of something defined in another part, and a reader looks it up.
Reviewed against engine v0.71.6
An IDML package becomes one document through id references: an attribute names the Self id of something defined elsewhere, and reading the document means looking it up.
In short Colours are in one part, styles in another, each spread and each story in its
own. The split works because the parts point at each other, and almost every link is the
same move: an attribute holds the Self id of an element defined somewhere else in the
package. Nothing is nested across parts; everything is referenced. This page lists the
links, what happens when one dangles, and the three references that chain instead of
resolving in one step.
From the design map to the parts
The design map's idPkg:* elements name parts by path: src="Stories/Story_u1a2.xml".
The content parts carry their own id inside (<Story Self="u1a2">), and by InDesign's
naming convention the file name repeats it. The resource parts have fixed paths:
Resources/Graphic.xml, Resources/Fonts.xml, Resources/Styles.xml and
Resources/Preferences.xml.
The id references
| Attribute | On | Names |
|---|---|---|
ParentStory | TextFrame | the Story that flows into the frame |
NextTextFrame, PreviousTextFrame | TextFrame | the neighbouring frames in the thread |
AppliedMaster | Page | the MasterSpread the page inherits from |
ItemLayer | every page item | the Layer in the design map |
AppliedObjectStyle | every page item | an ObjectStyle in Styles.xml |
AppliedParagraphStyle | ParagraphStyleRange | a ParagraphStyle |
AppliedCharacterStyle | CharacterStyleRange | a CharacterStyle |
FillColor, StrokeColor | page items, text, styles | a Color, Tint, Gradient or Swatch in Graphic.xml |
BaseColor | Tint | the Color the tint lightens |
Source | Hyperlink | a HyperlinkTextSource in a story |
Destination (typed property) | Hyperlink | a destination in the design map, or a text anchor in a story |
AssociatedTextVariable | TextVariableInstance | a TextVariable in the design map |
The value is the target's Self, exactly. Named resources have a Self that spells their
kind and name (ParagraphStyle/Body, Color/Black, Swatch/None), so references to them
read the same way. Objects such as stories, frames, layers and masters have short generated
ids (u1a2). Ids are unique across the whole package, which is why an id defined in one
part can be named from any other.
Two reference kinds point into stories rather than at whole elements. A hyperlink's text
destination is a HyperlinkTextDestination marker inside a story's text, and a
cross-reference's source is a CrossReferenceSource range there. Both are covered in
cross-references and hyperlinks.
A dangling reference
An id that names nothing is not fatal to the format. A careful reader treats it as unset:
a FillColor that names a missing colour paints nothing, an AppliedParagraphStyle with
no match falls back to the default style. A missing part is different: if the design
map names a part the archive lacks, the document is incomplete.
Two dangling cases change what InDesign keeps. A story that no frame names is discarded
when InDesign opens the file, and a Hyperlink whose destination it cannot bind is not
a hyperlink to InDesign at all.
In Paged: an unresolved id falls back; a part the design map names but the archive lacks stops the import.
Supported · verified
Three references that chain
BasedOn builds a style. A style names its parent in BasedOn and inherits every
attribute it does not set. Resolving a style means walking up that chain to the reserved
root ($ID/[No paragraph style], $ID/[No character style]). A reader should bound the
walk so a cycle cannot loop.
The applied styles build a run. This is a different chain. A run's effective formatting
starts from its own attributes, then takes what its character style sets, then what its
paragraph style sets. Each style in that sequence has already been resolved through its own
BasedOn chain. See the cascade.
NextTextFrame builds a thread. A story longer than one frame continues in the frame
named by NextTextFrame. The thread starts at the frame whose PreviousTextFrame is n
and follows the links until one is n. Again, a reader should stop on a cycle.
Why the split is worth it
Each part stays small and editable on its own. Change a swatch and only Graphic.xml
moves; rewrite a paragraph and only one story part changes; the ids that connect
everything stay put. The cost is that no part can be read in isolation: what a frame looks
like depends on its object style, its swatches and its story, each in a different part.
Frequently asked questions
How do the separate parts of an IDML document connect?
Through Self ids. An attribute in one part holds the id of an element defined in another:
ParentStory names a story, AppliedParagraphStyle a style, FillColor a swatch. Ids are
unique across the package.
What happens when a reference points at something that does not exist? A careful reader treats it as unset and falls back: no paint for a missing colour, the default style for a missing style. A part named in the design map but missing from the archive is a more serious fault, and InDesign itself drops a story no frame references.
Is BasedOn the same as the style cascade?
No. BasedOn is how one style inherits from another. The cascade is how a run combines
its own attributes with its character style and its paragraph style. A reader resolves
each style through BasedOn first, then cascades.
Which references chain instead of resolving in one step?
Three: BasedOn between styles, the run → character style → paragraph style cascade, and
NextTextFrame between frames. Each walk should stop on a cycle.
Content parts
The Spreads, MasterSpreads and Stories parts hold the document itself — pages and the items on them, the master pages, and the text, each tied in by id.
What InDesign needs to open a file
The rules a program writing IDML must follow for InDesign to open the file as intended — transforms, spread attributes, typed properties, part order.