beautypg.com

About automatic layout – Adobe InDesign CS5 User Manual

Page 580

background image

574

USING INDESIGN

XML

Last updated 11/16/2011

Important: The Map Tags To Styles command reapplies styles throughout a document, sometimes with unwanted
results. When you map a tag to a style, text that was previously assigned to one style may be reassigned to another,
depending on its XML tag. If you’ve already formatted some text, you might prefer to apply styles manually to prevent
your paragraph and character style choices from being overridden.

1 Choose Map Tags To Styles from the Tags panel menu or the Structure pane menu.

A menu of styles appears for each tag in the Map Tags To Styles dialog box

2 Do any of the following:

To import styles, tags, and mapping definitions from another document, click Load, choose a document, and click Open.

To map tags to styles individually, click the Style column adjacent to a tag, and choose a paragraph or character style
from the menu that appears. (The paragraph symbol identifies paragraph styles in the menu; an “A” identifies
character styles.) Repeat for each tag you want to map.

To automatically map tags to styles with the same names, click Map By Name. Styles with names that are identical
to tag names are selected in the Style column. To match, a tag and style must not only have the same name, but the
same case;

H1

and

h1

, for example, are not considered a match. (If the same style name exists in two different style

groups, Map By Name doesn’t work and you are alerted to rename one of the styles.)

3 Click OK.

More Help topics

Add paragraph and character styles

” on page 199

Create and load XML tags

” on page 581

About automatic layout

Using InDesign, you can automatically place imported XML content into a layout. To do this, you first create
placeholder frames or tables, and tag them with the same tag names as the XML elements you want to place into them.
Then, you import XML content into the placeholders in Merge mode. When tags match by name and by structural
hierarchy, InDesign merges the XML content, replacing any existing content in the document.

This technique is useful when you want to use the same layout for different sets of content. For example, a weekly
newsletter may have the same layout from week to week, but offer different content with each publication.

In order for imported XML to be merged directly into a layout, your document must meet these requirements:

Frames (or tables) in the document must be tagged with names identical to elements in the XML file that you intend
to import.