Chapter 11. Content Model Depth Issues and Their Impact on Round-Tripping XML

InDesign is a shallow content model when it comes to text and images on a page. There are no built-in XML tags for titles, lists, extracts, figure captions, and other element. So any XML structure that you create for text has to be modeled in an InDesign template or imported as a DTD to create tag names in the Tags panel.

Even more limiting is that there is no concept of text divisions such as chapter, sections, sidebars, notes, and so on. From an InDesign point of view, everything is a paragraph or a run of styled text within a paragraph; it wouldn’t make sense to “nest” a paragraph inside a paragraph. All of the deep structure of XML is superfluous to InDesign’s tasks of making nice-looking text on a page.

Despite these limitations, many people are trying to read and write complex XML within InDesign.

The Challenge of Mapping Deep DTDs to Shallow InDesign Structures

It is possible to transform the deep content structures of DocBook or DITA XML to paragraph and character styles. See Upcasting Versus Downcasting and Downcasting to HTML for explanations of the downcasting process used to flatten XML structure. The challenge here is the proliferation of styles required for enabling the upcasting that will be performed later. For example: in the XML, there may be an element called title at many different levels in the structure. In InDesign, you want the title to be styled according to its relative position in ...

Get XML and InDesign now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.