Chapter 6. Exporting XML

Marking Up (Tagging) Existing Content for XML Export

The “tagging” process is generally quite straightforward. Select objects or text, and then click a tag name in the Tags window’s list of tags (assuming that you have loaded tags). See the InDesign Help section “Tagging content to export to XML” for more information. For tables and images, I have provided more details in this section.

The Special Case of InDesign Tables (Namespaced XML)

A surprising number of layout people have never tried the table features of InDesign, preferring to group text frames to make tables. But because InDesign CS offers powerful table design and production, we will make good use of them for our XML processes.

We’ll work through some table exercises. First, to understand how InDesign represents a table as XML, we will start by saving a tagged table as XML:

  1. Select TableInsert Table. The Insert Table dialog opens. Create this table as two columns, with one heading row and three normal rows.

  2. Click in the top left edge of the first row to select the row, then select TableMerge Cells to combine the two cells into a single row.

  3. Repeat the Merge Cells operation for the second and fourth rows of the table, leaving the third row as two separate cells.

  4. Now use TableSelectTable to make sure the entire table is selected, then use the Tags palette to tag the entire table as <CourseDescriptions> (the root element of the sample XML file).

  5. Select the top row and type COURSE DESCRIPTIONS as the heading ...

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.