InDesign’s XML Features
InDesign has a clean, straightforward implementation of XML that encompasses several aspects of the interface from the Layout view and Structure pane, to the Story Editor and InCopy. Believe it or not, the program has provided some support for XML all the way back to version 2—but it’s so well hidden that you may never stumble across the features unless you’re specifically looking for them. Let’s take a closer look.
Layout View
We’re going to start off where most designers work, in Layout view. We check out the XML features in the Story Editor and InCopy later in this chapter.
Importing XML
InDesign’s XML import interface is your first stop in an XML workflow, but before anything can be imported you have to have an open document. Download the sample files for Chapter 2 from the book’s support site: www.peachpit.com/indesignxmlguide/. Open the file xml_interface_1.indt (Figure 2.1).
Figures 2.2 and 2.3 show how to import XML.
The XML Import Options dialog (Figure 2.4) is responsible for most of the XML magic. Take a minute to familiarize yourself with the possible settings (Table 2.1). We demonstrate what they do in detail in upcoming chapters.
XML Import Options
Option |
Description |
---|---|
Merge Content |
Replaces all existing XML content in your layout. |
Append Content |
Inserts (adds) imported XML content into the existing file. |
Create Link |
Creates a live link to the XML file stored on your hard drive. When the XML is changed, the Links panel indicates the file is out of date. |
Apply XSLT |
Uses an XSLT to manipulate the XML during import (InDesign CS3 only). XSLTs can be used to sort or filter the XML, or completely transform it into another data structure. |
Clone repeating text elements |
Automatically replicates tagged and untagged text and inline objects within your workflow. Use this option to create repetitive layouts, such as phone directories, price lists, business cards, catalogs, and so on. |
Only import elements that match existing structure |
Filters incoming XML elements against the existing document structure, preventing elements not already represented in the structure from entering the layout. |
Import text elements into tables if tags match |
Filters incoming XML elements against the existing structure of a table, placing them into table cells that are similarly tagged. |
Do not import contents of whitespace-only elements |
Causes InDesign to ignore white space (extra spaces, hard returns, and so on) stored within the XML file between the tagged elements. Instead, InDesign uses the spacing and alignments as depicted in your structured layout. |
Delete elements, frames, and content that do not match imported XML |
Deletes tagged page elements when the imported XML does not contain a similarly tagged item. This option prevents the inclusion of empty text and picture frames in your final layout. |
Import CALS tables as InDesign tables (InDesign CS3 only) |
CALS stands for Continuous Acquisition and Lifecycle Support, an initiative by the Department of Defense for the specification of standards for electronic documents. Technically speaking, XML can’t create objects, like tables. The CALS specifications were created so that the inclusion of tabular information could be compatible with the data-centric nature of XML. Choose this option to convert CALS-based tables into InDesign-supported tables. |
For the purposes of this lesson, leave all checkboxes unchecked and click OK.
When an XML file is imported into InDesign it does not automatically appear in your layout the way regular text and graphics do. Instead, InDesign loads it into an interface called the Structure pane and then populates the Tags panel with the names of the available elements.
The key word here is structure. Mention the word “structure” in a crowded room and you can instantly tell who works with XML because their eyes light up. Structure is at the heart of the technology. XML is all about how the pieces are put together. The Structure pane and the Tags panel work hand in hand to reveal the how. The Structure pane gives you the big picture—the view from 20,000 feet. The Tags panel brings you up close and personal.
Can we use any more clichés? Okay, two more: The Structure pane is the yin balancing the Tags panel’s yang. They are the one-two punch of InDesign’s XML interface. Let’s take a closer look at each one.