Import and merge xml – Adobe InDesign CS3 User Manual
Page 529
INDESIGN CS3
User Guide
522
5
Using the Text tool, click in the first frame to create an insertion point, and type placeholder text for each element
you want to merge into that frame. Include any spacing you want between elements, as well as any static text.
Note: If you will be importing repeating data, you only need to create one instance of sample text for the elements that
will repeat.
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).