Before you tag page items, create (or load) tags to identify each content type or item in your document. You can create tags from scratch or load them from another source, such as an InDesign document, InCopy document, or DTD file. Use any of the following methods to create or load XML tags for your document:
Create a tag with the New Tag command.
Load tags from an XML file or another document.
Import a DTD file.
Import tags (and content) using the Import XML command.
Select a color for the tag if you created your tag from the Tags panel menu. (If you created your tag with the New Tag button, you can choose a color by changing the color of the tag.)
You can assign the same color to different tags. The color you select appears when you apply the tag to a frame and choose View > Structure > Show Tagged Frames, or when you apply the tag to text within a frame and choose View > Structure > Show Tag Markers. (Tag colors do not appear in exported XML files.)
InCopy automatically adds tags to the Tags panel when you load an XML file.
You cannot change the name of locked tags. InCopy automatically locks tags specified in a loaded DTD file. To change the name of these tags, you must edit the DTD file and reload it into the document.
Before you export content to an XML file, you must tag the text and other items (such as frames and tables) that you want to export. You also need to tag items that you have created as placeholders for imported XML content. Items that have been tagged appear as elements in the Structure pane.
A. Elements appear in the Structure pane. B. Tag markers surround text to which tags have been applied.
Text frames must be tagged before you can tag the text inside them.
You can apply only one tag to a frame.
Threaded text frames share a single tag, which applies to all text in the thread, including overset text.
When you tag text within a tagged element (for example, when you tag a paragraph within a tagged story), the text appears as a child element of an existing element in the Structure pane.
When you tag an element within a frame with the Autotag button, InCopy automatically tags the frame using the tag specified in the Tagging Preset Options dialog box.
Using the Type tool , select text within a text frame, and then click a tag in the Tags panel. If you select all of the text within the frame, the tag is applied to the frame, not to the block of text (unless you’ve selected Add Tag in the Tags panel).
Select the text frame, table, table cells, or image that you want to tag, and click the Autotag icon in the Tags panel to apply a default tag. (See Specify Autotag defaults.)
Automatically tag text to which paragraph or character styles have been applied using the Map Styles To Tags command.
When you tag a table for export to XML, you create a table element as well as one cell element for each cell in the table. The cell elements are child elements of the table element and are created automatically.
You can also tag a table by selecting it and then clicking the Autotag icon in the Tags panel. The Table tag (or another tag of your choice) is applied immediately to the table, according to your Autotag default settings.
Paragraph, character, table, and cells styles you assign to text can be used as a means of tagging text for XML. For example, a paragraph style called Body can be associated with a tag called StoryText. Then, using the Map Styles To Tags command, you can apply the StoryText tag to all paragraphs in your document that are assigned the Body paragraph style. You can map more than one style to the same tag.
The Map Styles To Tags command tags content automatically, including paragraphs and characters that have been tagged already. To retain existing tags, apply tags manually.
Select the text or text frame, and then click a different tag in the Tags panel.
Place the insertion point in a tagged text frame within a story element (not a child element). Select Retag at the top of the Tags panel, and click a different tag in the Tags panel.
Select the entire block of text to which a tag has been applied, select Retag at the top of the Tags panel, and click a different tag. (If you select Add Tag at the top of the Tags panel, and then click a different tag, a new child element will appear in the Structure pane.)
When you select a text frame, table, table cells, or an image, and then click the Autotag icon in the Tags panel, InDesign applies a default tag to the item you selected. You can specify these default tags in the Tagging Preset Options dialog box.
When you select a text frame, table, table cells, or an image, and then click the Autotag icon in the Tags panel, InCopy applies a default tag to the item you selected. You can specify these default tags in the Tagging Preset Options dialog box.
InCopy applies a default tag when you create an element that requires a parent element, but doesn’t yet have one. For example, if you tag text within a text frame but the frame itself isn’t tagged, InCopy assigns the frame a tag according to the Tagging Preset Options. The capability to apply default tags helps InCopy maintain correct XML structure.
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.
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.
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.)
In Galley and Story views, tag markers indicate where items on a page have been tagged. In Layout view, tagged frames indicate where items such as tables and images have been tagged. The tag color determines the color of the marker or frame.
To display tagged frames in color, choose View > Structure > Show Tagged Frames.
To hide the color-coding of tagged frames, choose View > Structure > Hide Tagged Frames.
To display color brackets around tagged text, choose View > Structure > Show Tag Markers.
To hide color brackets around tagged text, choose View > Structure > Hide Tag Markers.
- To delete a tag from the Tags panel, drag it to the Delete Tag icon at the bottom of the panel. If the tag has been applied to content, an alert message appears. Select another tag to replace the deleted tag, and then click OK.
- To delete all unused tags, choose Select All Unused Tags from the Tags panel menu, and click the Delete Tag icon at the bottom of the panel.
- To delete an element from the Structure pane, select the element, and then click the Structure pane Delete icon or choose Delete from the Structure pane menu. If the element contains any content, an alert message appears. Click Untag to leave the content in the document; click Delete to delete both the element and its content.
Tags that were loaded with an imported DTD file cannot be deleted until the DTD file is deleted.