IDML Reference / Foundations
Read one by hand
Open the smallest valid IDML package and read its parts — a one-page, one-line document, focused on the story that holds the text.
Reviewed against engine v0.71.6
The fastest way to understand IDML is to open the smallest valid package and read it.
In short Below is a complete IDML document reduced to its smallest valid form: a single page with a single line of text. The embedded view focuses on the story — the part that holds the actual words — because that is the part you would edit to change what the page says. The rest of the package (the manifest, the resources, the spread) is there too; this page walks you through what to notice in the story and what every other part is quietly doing for it.
The fastest way to understand the format is to open the smallest possible valid package and read it. Below is a complete IDML document that holds a single page with a single line of text. The view shows the story — the part that holds the words; the rest of the package (the manifest, the resources, the spread) is there too, but this is the part you would edit to change what the page says.
A complete one-page document, reduced to its smallest valid form. This is the story part — the text lives here.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
<Story Self="ustory">
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>Hello, paged media.</Content>
</CharacterStyleRange>
</ParagraphStyleRange>
</Story>
</idPkg:Story>
A few things to notice, top to bottom:
- The outer
idPkg:Storyis the part wrapper; the innerStoryis the content, and itsSelfid is how the page's text frame finds it. - A
ParagraphStyleRangeis a run of text sharing one set of paragraph attributes; aCharacterStyleRangenests inside for character-level formatting. - The actual text sits in
Content. It is ordinary XML text, so&,<and>are written as&,<and>.
When there is more than one paragraph
This story has one paragraph, so it shows nothing between paragraphs. Add a second and
you meet the one rule that trips up most hand-edited files: a paragraph ends with a
<Br/> element, a sibling of Content inside the last CharacterStyleRange of the
paragraph. Every paragraph except the story's last ends with one.
Three paragraphs. The first two share one paragraph range and each ends with a
<Br/>; the second holds a forced line break (
). The third has its own
range because its spacing differs.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0">
<Story Self="ustory">
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>A first paragraph.</Content>
<Br/>
<Content>A second one, with a forced
line break inside it.</Content>
<Br/>
</CharacterStyleRange>
</ParagraphStyleRange>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" SpaceBefore="12">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]">
<Content>A third paragraph, set apart by its own SpaceBefore.</Content>
</CharacterStyleRange>
</ParagraphStyleRange>
</Story>
</idPkg:Story>
Three more characters are written the way InDesign writes them:
- A new paragraph is
<Br/>, not a new range. AParagraphStyleRangecan hold several paragraphs. Writing one range per paragraph without the mark gives InDesign one long paragraph. - A forced line break is the character U+2028 inside
Content. It breaks the line without ending the paragraph. - A tab is the character U+0009 inside
Content, often written	.
The paragraph model explains why IDML works this way.
That is the entire payload of the first document. Everything else in the package exists to give the story a page to live on and styles to resolve against, which is what the package anatomy section unpacks next.
Frequently asked questions
What is a "story" in an IDML file?
A story is the part that holds a run of text — the words themselves, grouped into
paragraphs and styled runs. The text frame on a page points at a story by its
Self id, so the page knows which words to flow into it.
Can I edit IDML text in a plain text editor?
Yes. The text lives in the Content element inside the story part, which is just
readable XML. To change what the page says, you edit the Content there. The
surrounding parts — manifest, resources, spread — give that story a page and styles
to resolve against.
What is the difference between a ParagraphStyleRange and a CharacterStyleRange?
A ParagraphStyleRange is a run of one or more paragraphs that share their paragraph
attributes. A CharacterStyleRange nests inside it for a stretch of characters that
share their character attributes. The text sits in Content elements inside the
CharacterStyleRange.
How do I start a new paragraph when editing by hand?
End the current paragraph with a <Br/> element after its last Content. Starting a new
ParagraphStyleRange alone does not end the paragraph: InDesign reads consecutive ranges
without a mark as one paragraph.