Chapter 3. Importing XML
There are several ways to work with Adobe’s XML import capabilities. We’ll start with the process that has been documented in an Adobe video tutorial.
Doing It Adobe’s Way: The Placeholder Approach
Adobe expects you to create a model within your InDesign document for your XML content.[1] The model is made of placeholders, which are XML elements that indicate what the structure of the incoming XML will be and how you want it to look.
This is a very sensible approach when you are starting out with XML and want to get a feel for how the imported XML will be formatted in InDesign. See Figure 3-1.
Note
If you import XML without any preexisting maps for paragraph styles, all the imported content will look like the default style that you get when you make a new paragraph without applying a style to it (the Basic Paragraph style).
Let’s walk through the steps of the placeholder approach, using the course description content.
Figure 3-1. The XML Import Options dialog with annotations
Modeling the XML You Want
Getting some structure into InDesign
The basis of your modeling will be a set of XML elements from an existing DTD or XML file. If you have XML based upon a DTD, start by importing the DTD[2] into InDesign:
In your InDesign document, select View→Structure or click the Structure pane icon <|> in the very far bottom-left corner of the document window.
Select Structure→Load ...
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.