What Are XML Tags?

A text frame with portions of text tagged and a tagged image frame with the Show Tagged Frames and Show Tag Markers options on.
XML tags (often times known as simply tags), are an InDesign feature that allow you to specify areas of content within a document, so that Fuga knows what text or images to put where.
What Can You Apply XML Tags To?
You can apply XML Tags to:
- Text Frames (to tag all the text in the frame)
- Graphic Frames
- Text Within a Text Frame
Nesting Tags
Tags can be nested, which means that you can place tags inside other tags. Keep in mind, however, that when replacing text in a tag with tags inside it the tags within it will be erased. Also, when nesting tags sometimes the brackets get a bit messy, so use the tips in our section on checking your tags bellow if you need to.
Root and Story
The Story and Root tags are default tags. Essentially, they do not have any implication on Fuga. The all tagged frames are within the root tag, and the story tag applies automatically to text frames with part of the text inside them tagged unless the whole frame is tagged with something else.
How Fuga Interacts with Tags
Tags are used in Fuga as a way to specify what content to modify. They are commonly used with actions that work with text or place images.
One of the most common uses of tags is the Load Data action, which tells Fuga to take the information from columns of a CSV and insert it into tags. You can tell Fuga which column relates to which tag, or Fuga can detect this relationship automatically if the tag names are a case sensitive match to the column names. For more on the Load Data action, see the article on Working With Data in Fuga (for a conceptual overview) or Load Data in the action reference (for an outline of the action’s functionality and examples).
There are many other things Fuga can do with tags. Fuga can place images into tagged graphic frames using the Load Data action (yes, it also works with images) or the Place action. Using the Get Text action, Fuga can also read the text inside tags and to put into a variable for use in the flow, and using the Replace Text action Fuga can change the text inside a tag. For many of the other actions that work with tags, see the actions in the Text Actions Category of the action reference.
Tags vs. Object Names
Tags and object names are similar in the sense that they allow Fuga to identify content. Object names apply only to objects, however, where as Tags can additionally apply to text within objects. Tags tend to specify what type of content an image or text is representing, where as an object name provides a way to select an object individually. Essentially, any object that you need to select individually you probably need to give an object name. At the same time however, when you use tags it is sometimes less necessary to select objects individually. Keep reading for more.
Tags and Selection
Working with tags in Fuga is a little bit more flexible then working with objects in that you do not have to worry as much about what is selected. Fuga checks for tags inside all the selected objects, and inside the selected Super Group (so objects don’t have be to selected directly). If more than one of the same tag is found, the action will be performed on all of them.
Writing Tags in Parameters
It is important to remember that when writing tag names in the flow, they always have quotes around them since they’re strings.
Working With XML Tags in InDesign
How To Create A New XML Tag
To create a new tag:
- Go to Window > Utilities > Tags to open the Tags panel if it isn’t already.
- Click the New button to add a new tag. Note: The Root and Story tags are in the Tags panel by default.
- Type in a name for the new tag that appears. Note: Tags can not have spaces, and (in order for them to work properly with Fuga) must not have any special characters such as quotes.
How To Tag Content
To tag content in the InDesign document:
- Hi-light the text or select the object that you wish to tag.
- In the Tags panel, click on the name of the tag to apply to it.
How To Untag Content
To remove a tag from content:
- Select the frame you wish to untag, or put your cursor inside the section of text to untag.
- Click the untag button in the Tags panel. Any tags nested within the tag will also be removed, if you wish to however you can retag this content after.
How to Delete A Tag
To delete a tag:
- Untag the content with the tag.
- Deselect everything.
- Press the trash can icon at the bottom of the Tags panel. If you did not untag everything, you will see the option to replace the tag with another. Optionally you can select Root from the list. If you use Root, the object will remain tagged but without much effect unless for some reason you’re working with the Root tag later (which isn’t recommended).
Turn on Tag Visibility
To turn on tag visibility:
- Go to View > Structure > Show Tag Makers. If you only see Hide Tag Makers it means that tag markers are already shown.
- Go to View > Structure > Show Tagged Frames. If you see only Hide Tagged Frames it means that tagged frames are already show.
Checking Your Tags
Visually
When working with tagged frames, with tag visibility on, you can fairly easy tell what’s tagged based on the way a frame looks. Brackets appear around the tagged text in the same color as the corresponding tag when tagging only a portion of text within the frame, and a red transparent background appears indicating that the frame is tagged with Story (the default tag applied to frames with text within them). If a whole frame is tagged, the frame’s background color and border becomes the color of the tag.
In The Tags Panel
To tell exactly what tag is applied to a piece of text or a text frame, select the frame or put your cursor inside the tagged text, and look at the list of tags in the tags panel. The highlighted tag is the one applied to it.
Structure Viewer
You can additionally see the nesting order of tags, and what tag’s applied to what by using the Structure editor. To open the Story Editor, go to View > Structure > Show Structure. To see the tags within the whole document, expand the root tag. To see the tags that apply to individual objects, you may have to expand the story tags, since tags within frames are automatically nested within a story tag (unless the frame itself has had another tag applied to it).
To see what tags are applied to a specific section of text or object, select the object or put the cursor inside the text and an underline appears under its tags in the structure viewer.