beautypg.com

Lay out xml manually, Map xml tags to styles – Adobe InDesign CS5 User Manual

Page 579

background image

573

USING INDESIGN

XML

Last updated 11/16/2011

3 Choose File

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

to import.

4 Select Show XML Import Options.

5 Select Append Content, and then click Open.

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

InDesign will list the XML file in the Links panel and display a yellow alert triangle in the panel if the XML file changes.

7 Click OK.

More Help topics

Link or embed imported text files

” on page 142

Import and merge XML

” on page 579

Lay out XML manually

You can manually place XML content in your document layout by dragging elements from the Structure pane to the
page or to existing frames. When you place an element, its child elements (and all child elements below those, if any)
are placed as well.

In the Structure pane, a structure-specific blue diamond appears on an element’s icon if the element has been placed
in the document; elements that haven’t been placed show an unplaced icon.

Note: If you imported XML using the Merge Content option, some elements may already be laid out. When you merge
imported content, InDesign automatically flows elements into existing frames if they are identically structured and
tagged.

1 Open the Structure pane (View

> Structure > Show Structure) and select the element that you want to lay out.

2 Do either of the following for each element you want to place in your document:

Drag the element onto the page. InDesign creates a frame for the element.

Drag the element onto an existing frame. If the frame contains content, it is replaced by content from the XML data.

3 To format the items you lay out, do any of the following:

Map XML tags to paragraph, character, table, and cell styles.

Apply styles to elements.

Format the selected content manually by choosing text options in the Control panel.

Map XML tags to styles

XML tags are merely data descriptions; they carry no formatting instructions. As such, you need to format XML
content after you import it and lay it out. One way to do that is to map XML tags to paragraph, character, table, or cell
styles. For example, the

Byline

tag could be mapped to the Author character style, so that all imported and placed

XML content that is tagged

Byline

is automatically assigned the Author character style. Mapping tags to styles makes

formatting imported XML content easier and less time-consuming.

You don’t need to map every tag to a paragraph or character style. Some elements may not appear in the layout and
others may be easier to format one at a time. Moreover, child elements take on the paragraph or character style that is
assigned to their parent, which can cause confusion unless you are careful to map parent and child elements separately.