InDesign

XML import and layout methods

After you import XML data, the imported content appears as elements (the basic building blocks of XML) in the Structure pane. InDesign doesn’t create new frames or pages when you import XML.

Append or merge?

You can import XML using one of two modes: append or merge. The method you choose depends on your workflow (manual or automated), how you want to handle existing content in your document, and whether you want advanced options for handling the imported data.

Append mode
When you append imported content, the existing structure and content of the document are left as is; the new XML content is placed on the bottom of the Structure pane, in the form of elements.

Merge mode
When you merge imported content, InDesign compares the incoming XML with the structure and names of elements already in your document. If the elements match, imported data replaces existing document content, and is merged into correctly tagged frames (or placeholders) in the layout. (Elements for which InDesign can’t find a matching name and hierarchy rank are placed on the Structure pane so that you can place them manually.) Merge mode not only makes automated layout possible, it provides more advanced import options, including the ability to filter incoming text and clone elements for repeating data.

Content layout

After importing XML content, your next step is to place it in your document. You can place content manually, automatically, or by using scripting. The method you choose depends on the content you’re importing, your document’s layout, and your workflow process.

Place content manually
With the manual method, you drag elements from the Structure pane onto the pages of your document or into frames. This method requires little setup or planning. Use this method if the type of content you import varies or if you acquire content from multiple sources.

Manually placing imported XML content

Place content automatically
By planning ahead, you can automate the process of placing XML data in your layout. To place XML content automatically, you first prepare the document by creating tagged placeholder frames to hold incoming XML. As long as the XML structure and tag names for incoming content matches the tag names and structure of the placeholder frames, InDesign can place the imported XML automatically in your document. InDesign can also clone elements to handle repeating data such as address lists and catalogue material. Use the automatic layout method as part of a structured workflow process to speed production time and efficiency.

The selected placeholder frame (above) is tagged with the Story element. When XML data is imported (bottom), the Story element placeholder frame is automatically populated with the Story element content.

Note: InDesign recognizes special namespace attributes that can specify paragraph or character styles in XML. For more information, see the XML technical reference guide and other resources at www.adobe.com/go/learn_id_XMLscript.