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.
Choose New Tag from the Tags panel menu.
Click the New Tag button on the Tags panel.
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.)
You can load tags from an XML file, an InDesign document, or an InCopy document.
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.
When tagging page items, note the following:
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.
InCopy creates a cell element for each cell in the table (you can display them in the Structure pane). The tag applied to table cell elements depends on your tagging present options.
For example, you can tag the first-row cells with a different tag to identify them as heading cells. To apply tags to cells, select the actual table cells in your document, and then select a tag. (Selecting cells in the table also selects the corresponding cell elements in the Structure pane.)
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.
Master Pages Stories
Maps styles found on the parent page to tags.
Maps styles found on stories on the pasteboard to tags. (Deselect this option to keep stories on the pasteboard from being tagged.)
Maps styles located in empty stories to tags. (Deselect this option to keep styles on empty stories from being tagged.)
The new XML tags are applied throughout your document to paragraph, character, table, and cell styles that you specified in the Map Styles To Tags dialog box.
Untag an item to remove its tag but retain the associated content.
Click Untag Element in the Structure pane menu.
Click the Untag button in the Tags panel.
Retag an item to replace the existing tag (you don’t need to untag it first).
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.
If the tag you need isn’t listed, you can choose New Tag from the menu and create a tag.
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.
Tags that were loaded with an imported DTD file cannot be deleted until the DTD file is deleted.