beautypg.com

Import and merge xml, Merge xml into existing content or placeholders – Adobe InDesign CS5 User Manual

Page 585

background image

579

USING INDESIGN

XML

Last updated 11/16/2011

6 Format the text as you want it to appear in the final document.

7 Tag the text frame with the tag for the parent element that will contain the elements (or repeating data) you want

to import into that frame.

8 Position the insertion point in the placeholder text and choose Edit > Edit In Story Editor.

9 Choose View

> Structure > Show Tag Markers.

10 Choose Edit > Select All.

11 In the Tags panel, select Add Tag, and then click the tag you assigned to the frame.

InDesign wraps the placeholder text with the tag, and adds the element to the Structure pane.

12 Select the text representing the first child element and click its tag in the Tags panel. Repeat until you have tagged

all the child placeholder text.

Important: When tagging placeholder text, do not select any spacing or static text you want to keep between elements.
Tag only the text you want replaced with XML content.

13 In the Structure pane, review the hierarchy created by your tagging to ensure it matches the structure of the XML

content you will import.

Import and merge XML

After you have created and tagged placeholder frames, tables, and text—and made sure that your document and the
incoming XML file have the same tags and structure—you can import XML content into your layout.

You must use the Merge Content option to import XML into placeholders (or to replace existing content in your
document). When merging content, InDesign replaces identically tagged and structured elements in your document
with the imported XML elements. You can use additional import options to exclude imported (that is, filter) content
that doesn’t match the document structure, to delete document items that aren’t matched or replaced by the imported
XML, and to clone repeating XML elements.

If the imported XML file contains elements that are not found in the document, InDesign places these elements in the
Structure pane without laying them out in your document.

To successfully merge XML into placeholders, keep these rules in mind:

Tag placeholders with the identical tag name as the XML element that will replace it (or be flowed into it).

In placeholder text, make sure any spacing, returns, tabs, or static text is outside the placeholder element tags, but
within the parent element for the story.

When you import the XML, select Do Not Import Contents Of Whitespace-Only Elements. (This preserves spacing
and static text if the XML elements you import consist of white spaces only.)

Merge XML into existing content or placeholders

1 Open the InDesign document that contains placeholders for the XML content.

2 Open the Structure pane (View

> Structure > Show Structure).

3 Choose File

> Import XML (or choose Import XML on the Structure pane menu), and then select the XML file you

want to import.

4 Select Show XML Import Options.

5 Select Merge Content, and then click Open.

6 To link the XML content to the original XML file, select Create Link.