Chapter 6. Inline and Anchored Graphics

<feature><title>Chapter Objectives</title>

In this chapter you will learn how to:

<objective>

Work with inline graphics in an XML workflow

</objective>
<objective>

Clone untagged anchored objects

</objective>
<objective>

Work with anchored graphics

</objective>
<objective>

Use nested styles to format untagged elements

</objective>
</feature>

So far we’ve explored the various ways text can be utilized in an XML workflow. We even threw a curve into the mix by introducing anchored objects in Chapter 5. But the only graphics used in our files were static. By now you’re wondering if using XML means boring, text-only documents. Fortunately, the answer is a resounding no!

In this chapter we show you how to incorporate graphics into your XML workflow. The concept for this chapter came to us one day when we were browsing through a bookstore and stumbled across an ideal candidate for this type of project. There on the display rack was a pocket atlas, one you might find at your local library or in your high school book bag. Chock-full of facts and images and using a repeating page layout, it was the epitome of a structured document.

Note

Download all applicable files for Chapter 6 from www.peachpit.com/indesignxmlguide and copy them to a folder on your hard drive (approximately 3 MB).

Sample Project: Atlas

Lesson 6-1: Anchored Objects, the Sequel

Scenario: You work for a publisher that specializes in printing maps and atlases. The production department sent over the layout for the latest project along with the XML file and support files to supply the content.

  1. Open atlas.indt from the Chapter 6 folder.

    Note

    In CS3, make sure the Open Normal radio button is selected in the Open a File dialog so you create a new document whenever opening a template file (.indt).

  2. Show the Structure pane, tag markers, and tagged frames.

  3. Select View > Show Frame Edges (Cmd-Shift-H/Ctrl-Shift-H), if they are hidden.

With the frame edges turned on, you should notice three anchored frames in the layout. One frame holds the flag, another the map, and the third is just for show. We discuss the strategy of using the third anchored frame in the sidebar “Anchored Object Strategy” later in the chapter. For now, let’s concentrate on learning how to combine text and graphics in your XML workflow.

Whenever you approach a project built by someone else, get into the habit of dissecting the structure to understand the order and placement of the tagged placeholders, and identify any elements to be cloned before proceeding to the next step (Figure 6.1).

Use the Structure pane and the Selection and Text tools to match the XML elements with their placeholders in Layout view.

Figure 6.1. Use the Structure pane and the Selection and Text tools to match the XML elements with their placeholders in Layout view.

  1. Select the dataroot element in the Structure pane. Import world_atlas.xml from the Chapter 6 folder.

  2. Select only the following checkboxes in the XML Import Options dialog:

    • Clone repeating text elements

    • Only import elements that match existing structure

    • Do not import contents of whitespace-only elements

  3. Deselect all other checkboxes. Click OK.

    • After a few seconds an atlas entry for the United States appears, replacing the placeholder items.

    • Nine other countries are listed in the Structure pane.

Ready for some more magic?

  1. Drag the second element icon from the Structure pane to the main text frame. Be careful to avoid the anchored frames!

    The entry changes, displaying information now for China, replacing the text and pictures for the United States completely. Wow!

  2. Drag the dataroot icon to the main text frame.

    • The frame changes color, matching the tag color for dataroot in the Tags panel.

    • The entry for the United States replaces China.

    • A red plus appears in the out port of the main text frame, indicating overset text.

  3. Using the Selection tool, click the out port on the main text frame to load the overset.

  4. Press Cmd-Shift-P/Ctrl-Shift-P to add a new blank page based on the atlas master page.

  5. Autoflow the overset text starting on the new page 2.

    • Eight more pages appear, identical to the first, displaying entries for nine additional countries.

    • Note how the flags and maps alternate positions on the left and right sides. This is caused by the Relative to Spine setting specified in the Object style applied to the anchored frame.

Lesson 6-2: Absolutely Graphical, Relatively Speaking

If you’ve been paying attention to how often we’ve mentioned that XML is a plain-text language, getting pictures to appear automatically in a structured layout may seem downright miraculous. But it’s really not that spectacular if you know anything about Web design (Figure 6.2).

Although HTML is a plain-text language, it has no problems supporting graphics. The HTML code simply tells the browser which graphic to load and where to find it.

Figure 6.2. Although HTML is a plain-text language, it has no problems supporting graphics. The HTML code simply tells the browser which graphic to load and where to find it.

Recall that, like XML, HTML is also a plain-text language, and it certainly doesn’t seem to have any problems dealing with graphics. Why? Because HTML doesn’t create the graphics; it simply references them in the code. In other words, it tells the browser where the graphics are stored on the Internet. For example, to insert a graphic called logo.jpg on a Web page, you insert the following code in the HTML:

<img src="logo.jpg">

Written this way, the reference indicates that the image file logo.jpg is saved in the same server and folder as the HTML file that is referencing it. If the graphic is stored elsewhere, you also have to include some path information indicating on what server and in which folder it can be found.

Paths come in two varieties: absolute or relative. Absolute paths leave nothing to chance, including the exact location of the graphic down to the server name, as in the following:

<img src="http://www.cookingwithxml.com/images/logo.jpg">

Relative paths are more open and flexible. They simply indicate where an image can be located in relation to the current Web page or document, such as:

<img src="images/logo.jpg">

The preceding reference tells the browser that logo.jpg is located in the subfolder images.

Absolute and relative references both have advantages and disadvantages. For example, using an absolute path tells the browser exactly where to find the graphic. That’s great if the graphic file is located in static location and you have to move the Web page files around, because the browser will always find the graphic—it’s in a fixed location. But if the graphic is moved, the path reference is suddenly wrong.

Relative references are great if the graphic is stored in the same location as the Web page or within a subfolder. Because the reference is relative, the entire folder (containing the Web page and the image) can be copied to a new location, or server, without breaking the path.

But how does this all relate to graphics in an XML workflow? XML uses a similar method to reference graphics, which can also be written as either absolute or relative. To re-create the same graphic reference cited earlier in XML, you would type the following:

Absolute: <image href="file:http://www.cookingwithxml.com/images/logo.jpg" />

Relative: <image href="file://images/logo.jpg" />

Let’s see how the graphics are referenced within the atlas XML file.

  1. Launch TextEdit or Notepad, or your favorite XML editor.

  2. Open world_atlas.xml from the Chapter 6 folder.

  3. Scroll down to the sixth line: <flag href="file://images/us-flag.pdf" />.

It should be pretty obvious that this piece of code references the name and location of the U.S. flag graphic used in the atlas. Because the reference doesn’t spell out the hard drive or Web server name, we can also deduce that this is a relative reference. Therefore, the file us-flag.pdf should be located in a subfolder called images. Let’s check it out.

  1. Switch to the Mac Finder or Windows Explorer.

  2. Navigate to the Chapter 6 folder.

  3. Locate and open the images subfolder (Figure 6.3).

    Using a relative path, the graphic can be in the same location as the XML file or within a subfolder.

    Figure 6.3. Using a relative path, the graphic can be in the same location as the XML file or within a subfolder.

Within the images subfolder you should find all the graphics used in the atlas, including us-flag.pdf. InDesign is able to find and import these graphics because they are stored in a subfolder relative to the location where the XML file is found. As with all relative references, you can move the XML file to any computer or hard drive you please, just as long as you also move the images subfolder to the same location.

So, the important thing to understand is that the XML file doesn’t create the graphic; it simply identifies which graphic to import and where it can be found.

Lesson 6-3: Building the Atlas Template

With the experience of putting together the cookbook in Chapter 5 under your belt, building the structured layout for the atlas should be a simple matter. As always we start with the basic document setup:

  1. Create a new document with the specifications shown in Figure 6.4.

    Use these specs for the atlas template.

    Figure 6.4. Use these specs for the atlas template.

  2. Import world_atlas.xml.

    The XML Import Options dialog appears.

  3. Deselect all checkboxes in the XML Import Options dialog. Click OK.

    The XML content loads into the Structure pane.

  4. Option-click/Alt-click on the triangle in front of the dataroot element in the Structure pane

    All elements are revealed.

  5. Observe the first Flag element in the Structure pane.

You should notice that the icon clearly indicates that the Flag element is a graphic (see Table 2.1 in Chapter 2). In place of the data text snippet you’ll see the icon for an XML attribute and, beside it, the attribute text snippet.

  • Double-click on the attribute icon for the Flag element in the Structure pane.

    The Edit Attribute dialog opens (Figure 6.5).

    Since XML doesn’t create or support graphics itself, it simply stores the location of the graphic file instead. This is an example of an absolute graphic reference.

    Figure 6.5. Since XML doesn’t create or support graphics itself, it simply stores the location of the graphic file instead. This is an example of an absolute graphic reference.

Observe the attribute’s Name and Value. The name, HREF, stands for hypertext reference and is used in HTML to display a graphic on a Web page. The Value attribute stores the path describing the exact location of the graphic file. Whenever a graphic is placed in InDesign and tagged with an XML element, the program constructs this attribute automatically using an absolute reference (see Lesson 6-2).

  1. Click OK to close the dialog.

  2. Drag the first world_atlas icon from the Structure pane to the main text frame on page 1.

    The text data, map, and flag of the United States appear in the text frame as a continuous, unformatted flow. The flag and the map appear at 100 percent scale as inline graphics.

Stop a moment to enjoy the miracle you just witnessed. The magic might not seem that impressive unless you remember that the Structure pane itself contains no graphics, just path statements like the one we observed in step 6 and earlier in Lesson 6-2. Yet that’s all InDesign needs to track down the proper graphic and place it in your layout. Fantastic!

Note

Although there’s no limitation on the size of the image or graphic that can be imported, for the purpose of this project we created each flag and map at exactly the same scale so they would fit precisely in the frames provided in the layout.

In the Structure pane you should see ten total entries for the atlas, but to build the structure you only need the one element already placed in the layout. In fact, as we describe in Chapter 5, the remaining elements must be deleted or they will wreck the structure. As long as you delete the superfluous elements before importing the XML, it doesn’t matter when you do it. So, now is as good as any other time.

  1. Select the second world_atlas icon in the Structure pane.

  2. Hold the Shift key and select the last icon in the Structure pane.

    All elements are selected except for those above the first word_atlas icon.

  3. Click the trash can icon at the top of the Structure pane or press the Delete key.

    The selected icons disappear. This removes the XML elements from the Structure pane as well as from the document pages.

Now you’re ready to start building the formatted structure.

Lesson 6-4: Anchoring Graphics

The graphics placed automatically by flowing XML into a document appear in the text as inline anchored objects. This default behavior comes in handy in many XML workflows. In this particular layout we want the graphics to appear in specific locations on the page. In this lesson we set up the proper relationship for the anchored graphics.

Before we begin, it’s important to observe some key aspects of our current structure.

  • Reveal the contents of the world_atlas element in the Structure pane and observe the Flag and Map child elements.

Note how each is on a line of its own and separated by the continent element. No matter what you do in the final structure, it’s vital that these elements (as well as all the others) remain in the order currently displayed so they match the structure of the imported XML.

  1. Using the Selection tool, click on the flag graphic.

    Selection handles appear around the inline graphic.

  2. Select Object > Anchored Object > Options.

    The Anchored Object Options dialog appears.

  3. Enter the specifications in the dialog shown in Figure 6.6.

    These specifications reposition the flag graphic to the desired location.

    Figure 6.6. These specifications reposition the flag graphic to the desired location.

  4. Click OK.

  5. Using the Selection tool, click on the map graphic.

    Selection handles appear around the inline graphic.

  6. Select Object > Anchored Object > Options.

    The Anchored Object Options dialog appears.

  7. Enter the specifications in the dialog shown in Figure 6.7.

    These specifications reposition the map graphic to the desired location.

    Figure 6.7. These specifications reposition the map graphic to the desired location.

  8. Click OK.

Moving the two anchored graphics to the top of the page has left some unwanted gaps in the text. Getting rid of the extra space won’t hurt the structure—if you’re careful (Figure 6.8).

Here the map graphic has been floated from its original position in its own paragraph, leaving an undesirable hole in the text. The dashed line indicates the location of the frame’s anchor marker.

Figure 6.8. Here the map graphic has been floated from its original position in its own paragraph, leaving an undesirable hole in the text. The dashed line indicates the location of the frame’s anchor marker.

  1. Press Cmd-Y/Ctrl-Y to switch to Story Editor or select Edit > Edit in Story Editor.

  2. Insert the cursor after the first anchor icon. Press the Delete key.

    The continent placeholder moves up behind the icon.

    Note

    When deleting the paragraph return and other spacing between the tagged placeholders, be careful not to delete any tags or placeholders.

  3. Delete the paragraph return after the second icon.

Now it’s time to insert the background frame as an anchored object.

  1. Select the blank first line of text and the content and tags of the subsequent countryID element. Press the Delete key.

    • The countryname element shifts to the first line.

    • The cursor should still be inserted before the countryname tag.

  2. Press Cmd-Y/Ctrl-Y to return to Layout view. (Anchored objects can only be inserted in Layout view.)

  3. Select Object > Anchored Object > Insert.

    The Anchored Object Options dialog appears.

  4. Enter the specifications in the dialog shown in Figure 6.9.

    These settings create an anchored object used as the background for the flag and map graphics.

    Figure 6.9. These settings create an anchored object used as the background for the flag and map graphics.

  5. Click OK.

    A new anchored object appears near the top of the page.

  6. Set the background frame color to Paper. Set the stroke color to Black. Set the stroke width to 2 points.

    All anchored objects are in their desired locations.

Lesson 6-5: Creating Object Styles

One potential problem that can disrupt XML workflows is that anchored objects can shift from their desired locations during cloning when their positions are manually formatted. To prevent object shifting altogether, formalize the design using Object styles.

To create Object styles do this:

  1. Using the Selection tool, click on the anchored background frame.

    Selection handles should appear around the active anchored graphic.

  2. Select New Object Style from the Object Styles panel menu.

    • The New Object Style dialog appears.

    • All formatting options are selected by default, except for Paragraph styles.

    • The dialog should automatically pick up the formatting applied to background frame.

If you have never used it (or changed the settings) before, all checkboxes in the New Object Style dialog are checked by default, except for the Paragraph styles settings. By having the formatted frame selected, all the specifications you just applied will be automatically captured when the new Object style is created. The settings we are most interested in are Fill, Stroke, and Anchored Object Options, but make sure all the boxes remain checked to maintain consistent formatting. For anchored graphic objects, the Paragraph styles settings are irrelevant, but come in handy for anchored text frames like the one used in the cookbook in Chapter 5.

  1. Name the style Backframe. In CS3, select the Apply Style to Selection checkbox. Click OK. In CS2, apply the style to the background frame.

  2. Select the flag graphic.

  3. Select New Object Style from the Object Style panel menu.

  4. Name the style Flag. In CS3, select the Apply Style to Selection checkbox. Click OK. In CS2, apply the style to the flag graphic.

  5. Select the map graphic.

  6. Select New Object Style from the Object Style panel menu.

  7. Name the style Map. In CS3, select the Apply Style to Selection checkbox. Click OK. In CS2, apply the style to the map graphic.

All objects are now styled properly.

Lesson 6-6: Send in the Clones, the Sequel

In Chapter 5, we added the words Ingredients and Directions to the structured layout so they could introduce the appropriate parts of each recipe. These words were then cloned automatically when the XML file was re-imported later. In the atlas template from Lesson 6-1, you may remember seeing bolded words introducing each of the descriptive paragraphs of data. As you can see in your current layout, the XML data itself features no such words, which means you must add them manually to the layout before the template can be complete.

We learned in the cookbook example that cloned text must be inserted outside the tagged placeholders. But unlike in the cookbook, the words you add to the atlas structure will not be on a line/paragraph of their own—they will be in the same paragraph as the XML placeholders.

But before we proceed, we have to take care of a bit of housekeeping. You may have noticed that some of the text has slipped under the anchored frames and become inaccessible. Addressing the problem now will save you some trips to Story Editor or other equally undesirable contortions.

  1. Use the Text tool to select the text United States in the first line.

  2. Format the text as Myriad Pro, Bold, 18-pt. on 20-pt. leading, 11 picas space after the paragraph.

    The hidden text moves out from under the anchored frames.

  3. Select the main text frame in your layout. Press Cmd-Y/Ctrl-Y to switch to Story Editor (it’s easier to see the tags in Story Editor).

  4. Type Continent: including a single space directly in front of the opening continent tag.

  5. Type Description: including a single space directly in front of the opening desc_hist tag.

  6. Type Area: including a single space directly in front of the opening area tag.

  7. Type Geography: including a single space directly in front of the opening desc_geo tag.

  8. Type Population: including a single space directly in front of the opening population tag.

  9. Type Culture: including a single space directly in front of the opening desc_culture tag.

  10. Type Language: including a single space directly in front of the opening Language1 tag.

  11. Delete the paragraph return after the closing Language1 tag.

  12. Insert the cursor between the closing Language1 tag and opening Language2 tag. Select Type > Insert White Space > Em Space.

  13. Delete the paragraph return after the closing Language2 tag.

  14. Insert an em-space between the closing Language2 tag and opening Language3 tag.

  15. Insert a single paragraph return after the Language3 tag but delete any other extraneous paragraph returns or spacing that creeps into your structure.

    Note

    Inserting one extra paragraph return at the end of a structured layout is necessary to get it to clone properly.

  16. Apply the Basic Paragraph style to the empty line.

The structure now includes all the text and objects that will be cloned, as shown in Figure 6.10. You’re nearly finished.

Note the location of the anchor icons and the untagged text introducing the paragraphs.

Figure 6.10. Note the location of the anchor icons and the untagged text introducing the paragraphs.

Lesson 6-7: Formatting the Structure

By this time, formatting the structure should be second nature to you. If you’ve been paying attention, you understand that formats applied to the XML placeholders transfer to the imported data and then are cloned on each page of the layout. All sorts of glitches can happen to a structured layout as it’s being cloned, and we’ve determined that you preclude most of the problems by creating and applying Paragraph, Character, and Object styles to the structured layout before importing the XML whenever possible.

Paragraph styles have sufficed in our workflow up until now. But to make the atlas and other documents look good, you’ll discover that Character styles are equally important. And the most powerful application of Character styles also happens to be one of our favorite InDesign wündertools: nested styles.

Nested styles, like Lerner and Lowe, or chocolate and peanut butter, are happy confluences of two great things. The tool combines Paragraph and Character styles in an ingenious way that is also ideal for a structured XML workflow. It allows you to apply Character styles automatically to parts of paragraphs based on their intrinsic structure. How much better can it get?

For example, each paragraph of atlas data is introduced by one of the words you typed in Lesson 6-6 (Continent, Description, Population, and so on). In the original template, each of these words is formatted differently than the text in the rest of the paragraph. You could format these words manually and hope they retain the format as the placeholders are being replaced and cloned, but that’s like hoping the tooth fairy will leave a winning lottery ticket under your pillow.

The problem with the atlas is that the introductory words are untagged. Using the tools you have learned so far, there’s no way to guarantee that these words will maintain their formatting during cloning—except by using nested styles.

Let’s see how nested styles work in a structured layout:

  1. Select the word Continent: (including the colon).

  2. Format the text as Myrid Pro, Regular, 9-pt., with 10-pt. leading. Add 6-pt. spacing after the paragraph.

  3. Select New Paragraph Style from the Paragraph Styles panel menu.

  4. Name the style continent. Match the spelling and case of the XML tag exactly as it appears in the Tags panel. In CS3, click the Apply to Selection checkbox. Click OK.

    • The continent style appears in the Paragraph Styles panel.

    • In CS3 the Paragraph style is automatically applied.

  5. In CS2, apply the continent style to the paragraph.

  6. Select Bold from the Font pull-down menu and increase the font size to 11 pt.

  7. Select New Character Style from the Character Styles panel menu.

  8. Name the style Bold title. Click OK.

    The Bold title style appears in the Character Styles panel.

  9. Click the Clear Overrides button at the bottom of the Paragraph Styles panel.

    The format of the selected text returns to the Paragraph style’s default format.

  10. Double-click continent in the Paragraph Style panel.

    The Paragraph Style Options dialog appears.

  11. Select the Drop Caps and Nested Styles tab in the Paragraph Styles Options dialog.

  12. Click the New Nested Style button. Assign the specifications shown in Figure 6.11.

    These specifications automatically format the first word (and colon) as the Bold title Character style.

    Figure 6.11. These specifications automatically format the first word (and colon) as the Bold title Character style.

  13. Click OK.

    The paragraph style updates to apply the Bold title style to the Continent: text at the beginning of the paragraph.

Lesson 6-8: Creating Styles for Each XML Element

Because each of the subsequent paragraphs needs to be formatted identically to this one, we could use the continent style for all of them and map it manually to each of the XML elements. But we prefer to have Paragraph styles named for each of the XML elements.

  1. Select Duplicate Style from the Paragraph Styles panel menu.

    1. The Duplicate Paragraph Style dialog appears.

    2. The Style Name field displays the text continent copy.

  2. Change the name to desc_hist. Match the spelling and case of the XML tag exactly as it appears in the Tags panel.

    Note that the new style is based on the continent style.

  3. Click OK. Apply the desc_hist style to the paragraph.

  4. Repeat steps 1 through 3 until you have created and applied a style for each of the XML elements applied to placeholder paragraphs, except for Language2 and Language3. Because the Language2 and Language3 elements share a paragraph with the element Language1, only one style is needed.

  5. Select the text United States in the first line of the layout and create a new Paragraph style named countryname.

Note how the New Paragraph Style dialog picks up the formatting of the existing text. But one setting has not been applied yet. As is, the imported XML content will form a continuous text flow filling every text frame top to bottom. That means if one atlas entry doesn’t use the entire page, the next entry will automatically start in the remaining space. Egads! Don’t worry; we describe the solution in “Styles Essential to XML Magic” in Chapter 4.

  1. Select the Keep Options tab in the New Paragraph Style dialog.

  2. Select On Next Page from the Start Page pull-down menu. Click OK.

  3. Apply the countryname style to the paragraph.

The structured layout is nearly complete.

Lesson 6-9: Mapping Tags to Styles

For the cloning to work properly when the XML is re-imported, the relationship between the XML tags and the newly created paragraph styles has to be formalized. This is done by mapping the tag names to the Paragraph styles.

  1. Select Map Tags to Styles from the Tags panel or the Structure pane menu.

    The Map Tags to Styles dialog appears.

  2. Click the Map by Name button.

    The XML elements will be matched to their style counterparts automatically.

    Note

    All the elements will have a style match except for dataroot, world_atlas, countryID, flag, map, Language2, and Language3.

  3. Click the Preview checkbox to review the formatting.

    The text in the layout should format according to the mapping specifications.

  4. If everything seems formatted appropriately, click OK. Otherwise confirm that the tags are mapped to the correct Styles and then click OK.

Before testing the atlas, let’s save the file.

  1. Select File > Save As.

  2. Name the document my_atlas and save it as an InDesign template in the Chapter 6 folder.

  3. Close the file.

Lesson 6-10: Testing the Template

Nervous? Let’s see if your structured atlas design works.

  1. Open my_atlas.indt to create a new document.

  2. Select the dataroot element in the Structure pane.

  3. Import world_atlas.xml.

  4. Select only the following checkboxes in the XML Import Options dialog:

    • Clone repeating text elements

    • Only import elements that match existing structure

    • Do not import contents of whitespace-only elements

  5. Deselect all other checkboxes.

  6. Cross your fingers and click OK.

    • After a few seconds the United States entry appears, replacing the placeholder items.

    • All the entries are formatted as specified.

    • All ten countries are listed in the Structure pane.

  7. Drag the dataroot element to the main text frame.

    • The frame color changes to match the dataroot element.

    • The text frame displays a red plus (+) indicating it contains overset text.

  8. Create a new page and autoflow the remaining content into the main text frame on page 2.

    InDesign flows the content onto page 2 and creates 8 additional pages for the remaining data.

Quick, it’s not too late to list your socks on eBay!

Lesson 6-11: Troubleshooting the Structure

If you followed the instructions carefully, everything should have worked as in the sample template in Lesson 6-1. If something messed up, first try to identify the error. Next, press Cmd-Z/Ctrl-Z to reverse the process and then check the following items in the structured document for errors before trying it again:

  • Placeholders tagged properly

  • Placeholders in the proper order

  • Tags mapped to the proper styles

  • One untagged and unformatted paragraph return at the end of the placeholder text

  • Extraneous elements deleted from Structure pane

  • Root element selected before importing

  • Correct options selected in XML Import Options dialog

Fix any problems and then try it again.

Lesson 6-12: Broken World

Although there’s only one way to create a functioning XML workflow, there are unlimited ways of creating a broken one. Lesson 6-11 can help you track down a problem originating in your structured document, but what do you do if the error is coming from the XML itself?

There’s not enough space in this book to discuss every possible error you can encounter in an XML file, but we’d like to show you at least one common problem you may experience and its simple solution.

  1. Open atlas.indt.

  2. Select the dataroot element in the Structure pane.

  3. Import bad_atlas.xml.

  4. Select only the following checkboxes in the XML Import Options dialog:

    • Clone repeating text elements

    • Only import elements that match existing structure

    • Do not import contents of whitespace-only elements

  5. Deselect all other checkboxes. Click OK.

    The Find: us-flag.tif dialog appears (Figure 6.12).

    If InDesign can’t find the referenced graphical element, it asks you to do so using this dialog.

    Figure 6.12. If InDesign can’t find the referenced graphical element, it asks you to do so using this dialog.

If you look in the title bar of the dialog you can see that InDesign is looking for a file called us-flag.tif. Unfortunately all the graphics used in this workflow are saved as PDFs, not TIFFs. In other words, a simple typo has ground this workflow to a halt. But, instead of crashing or doing some other undesirable reaction, InDesign politely asks us to locate the missing file. Using this dialog you can track down the actual location of us-flag.tif or simply redirect InDesign to a proper replacement.

  1. Navigate to the images subfolder and select us-flag.pdf. Click Open.

    The Find: us-map.tif dialog appears.

  2. Select us-map.pdf in the images subfolder and click Open.

    • The remainder of the XML import should proceed without further error.

    • The atlas entry for the United States replaces the placeholder text and graphics.

If this happens to you during a real project, open the XML file in your favorite editor (see Chapter 3) and examine the file and path names. Make any corrections necessary and save the file.

Review

We’ve come a long way in the last three chapters. If Chapter 6 feels like a blur, here’s a recap to put it back in focus. You learned:

  • How XML works with inline graphics

  • How to clone untagged anchored objects

  • How to work with anchored graphics

  • How to use nested styles in a structured document

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.195.215