Find/Change elements and attributes in structured documents

Understand how you can find and change XML elements and attributes in Adobe FrameMaker.

In this topic

Find elements and attributes

You can search for elements and attributes in a structured document to keep track of them or to make changes to the element content quickly.

You can search for an element, attribute name, and attribute value either separately or in combination. For example, you can search for an <li> element to find each <li> element, or perhaps you limit the search to find only <li> elements that have an @audience attribute set to administrator.

To search for an element, an attribute, or an attribute value, do the the following:

  1. Choose Edit > Find/Change.

  2. Select Element from the Find drop-down list.

  3. Select the options you want in the Find Element dialog box.

    The settings can be used in many combinations. These are a few examples:

    • To find any element, leave all three boxes empty.

    • To find a specific element, type an element name but leave the Attribute Name and Attribute Value boxes empty.

    • To find any element with a specific attribute, type an attribute name but leave the Element Tag and Attribute Value boxes empty.

    • To find any element with a specific attribute value, type an attribute value but leave the Element Name and Attribute Name boxes empty.

    • To find a specific combination of element and attribute, type an element name and choose an attribute name.

    • To find a specific combination of element and attribute value, type an element name and choose an attribute name and an attribute value. If the attribute type is Choice, type the value.

    • To find a specific element with an attribute that has no value, type an element name and choose an attribute name, and select No Value from the Attribute Value drop-down list.

    Leave a box empty if you do not want to restrict the search. An empty box has the same effect as searching for any element, or choosing either Any Attribute or Any Value.

  4. Click Set.

  5. In the Find/Change dialog box, select Consider Case, Whole Word, Use Wildcards, or Find Backward.

  6. Click Find.

Change elements and attributes

You can search for elements and attributes in a structured document and change them quickly with the Find/Change feature. This is especially useful when you want to apply the same change to more than one occurrence of an element or attribute.

After you find an element, attribute, or attribute value, you can change it to another element, attribute, or value. For example, you can quickly and globally change the value of a @audience attribute from administrator to enduser.

When changing items in a document, you can change each occurrence of the item as it is found or have FrameMaker automatically make the change throughout the document.

Tip: After pasting material from another document or importing new element definitions, use Find/Change to clean up your document. For example, pasting a table from an unstructured document gives the table and its parts default, invalid element tags. You can use Find/Change to change <CELL> elements, for example, to <entry> elements.
  1. Choose Edit > Find/Change.

  2. In the Find/Change dialog box, choose Element from the Find drop-down list.

  3. Select the options you want in the Find Element dialog box, and click Set. Then choose an option from the Change drop-down list in the Find/Change dialog box, and type the replacement element name or value.

    The Find Element dialog box and the Change drop-down list work together. These are a few examples of combinations you can use:

    • To change one element to another, type an element name in the Find Element dialog box but leave Attribute Name and Attribute Value empty. Then select Element Tag To in the Change drop-down list and type an element name.

    • To change one attribute to another, type an attribute name but leave Element Tag and Attribute Value empty. Then select Attribute Name To and type an attribute name that is defined for this element.

    • To change one attribute value to another, type an attribute value but leave Attribute Name and Attribute Value empty. Then select Attribute Value To and type a value.

    • To change an attribute with a specific name to a certain value, type an attribute name but leave Element Tag and Attribute Value empty. Then select Attribute Value To and type a value.

    • To change a specific element with a specific attribute value to another element, type an element name and choose an attribute name and attribute value. Then select Element Tag To in the Change drop-down list and type an element tag.

    • To remove an attribute value, type an attribute value but leave Element Tag and Attribute Name empty. Then select Attribute Value To and leave the Choose box empty.

    If you try to make a change that is not allowed—for example, if you try to remove an element tag—an alert message appears explaining the problem.

  4. Click Find.

  5. When FrameMaker finds the element or attribute, do one of the following:

    • To make the change but not continue searching for other occurrences of the item, click Change.

    • To make the change and continue searching for other occurrences, click Change & Find.

    • To change all occurrences of the item, specify all occurrences in the document or only occurrences in the current selection and click Change All.