The Tags Panel Close-up
The Tags panel has second billing in your XML extravaganza, just under the Structure pane. Tags are used to identify every XML element in a structured layout. They can be applied to frames—both graphic and text—paragraphs, sentences, words, and even down to individual characters. Tags can also be empty or wrapped around other elements, as when a child element is nested within a parent element (described in Chapter 1).
Open xml_interface2.indt from the Chapter 2 folder (Figure 2.15).
Figure 2.15 This file features a fully structured layout, can you tell? If your XML interface is turned off, it will look like any other InDesign document—a page with a graphic and a bunch of text. Don’t let that fool you. A structured InDesign document is just like the ocean: Most of the action is happening under the surface.
Figure 2.17 The Tags panel is used to create, edit, import, or delete tags; to identify currently tagged elements within your layout; or to assign tags to your content or XML placeholders. The Tags panel displays all the available XML elements. Notice the color chip associated with each tag name.
Figure 2.18 shows how to expose the remaining parts of InDesign’s XML interface, and Figure 2.19 displays how the InDesign layout should look when the XML structure is all turned on. The tag markers appear as colored brackets at the beginning and end of each element. Tagged frames appear as if they are filled with the tag color. All this color is intended as a visual cue to help identify the XML elements. Don’t worry, the brackets and colored frames do not print or appear in exported files, such as JPEGs or PDFs.
Identifying Tagged Elements
Figure 2.23 You may notice the text Clos Lucé, France has no brackets. This text is technically untagged—there is no element for Place of death. Because the text has no tags of its own, it automatically assumes the tag of the parent element or the frame in which it resides.
Whoops! We just made a mistake. Notice how all the other XML tags in the panel shown in Figure 2.25 are typed in lowercase? You should open the actual XML file to be certain, but assume for this exercise that Portrait should be lowercase, too. Let’s edit the tag we just created to conform with all the other element names (Figures 2.26 and 2.27).
Tag names are added to the panel automatically whenever you import an XML file. But this method imports the XML data contained in the file as well. If there is no need for the data, InDesign provides a method for importing only the tag names from XML files and even from other InDesign or InCopy documents (Figures 2.28 through 2.30).
Deleting Unused Tags
You can delete tags at any time within your document, whether they are used or unused. Figure 2.31 illustrates how to delete unused tags.
Deleting Used Tags
Deleting a tag that is currently assigned to one or more elements within your document could damage your XML structure, so InDesign adds an extra step to the process to prevent any trouble (Figure 2.32).
Figure 2.32 Select and delete the image tag. This tag is assigned to the graphic frame on page 1. When an assigned tag is deleted, InDesign requires that you retag tagged elements with another tag from the panel. Select portrait as the replacement tag. Click OK.
After editing, renaming, and deleting tags, you may want to share your new list of tags with coworkers or use them in other workflows. InDesign provides an easy way to save the tag list to a separate file (Figure 2.33).
Applying Tags to Text
Tags can be applied to both text and graphics. Open xml_interface_3.indt. Figure 2.34 shows how to apply a tag to text.
Figure 2.34 Using the Text tool, select the text Clos Lucé, France. Click the tag placeofdeath in the Tags panel. You can also right-click on the selected text and choose placeofdeath from the Tag Text context submenu.
Applying Tags to Graphics
To apply tags to graphics, follow Figure 2.35.
Changing Tag Assignments
Figure 2.36 shows how to change tag assignments.
Untagging Graphics and Text
At some point in your workflow, the XML tags and structure may no longer be needed. While tags can sit in graphic or text frames for years without causing you a whit of trouble, InDesign provides an easy way to remove all traces of the XML structure. Figures 2.37 through 2.40 show you how to untag graphics, text, an entire text frame, and everything on a spread, in that order.
Figure 2.38 Using the Text tool, select the entire text of or simply insert the cursor somewhere within Claude Monet. Click the Untag button in the Tags panel or right-click on the selection and choose Untag Text.