Using Refactoring to Rename or Delete XML Schema Components

See Also

You can use refactoring in XML schema tools to rename or safely delete schema components and update all references throughout your project. You can use the following refactoring actions in XML schema files:

To rename an XML schema component:

  1. Open the XML schema file in the Schema view or the Design view of the XML schema editor.
  2. Navigate to and select the XML schema component to rename.
  3. Right-click and choose Refactor > Rename from the pop-up menu.
    The Rename dialog box opens.
  4. In the New Name field, type the new name of the XML schema component.
  5. To preview all changes in the XML Refactoring window, select the Preview All Changes checkbox.
  6. Click Next.
    The IDE finds all usages of the XML schema component and shows the results in the XML Refactoring window. The preview shows the components in the project files.
  7. In the XML Refactoring window, review the refactoring changes.
  8. Clear the checkbox of any node where you do not want to change the name of the XML schema component.
  9. Click Do Refactoring to apply the selected changes.
    The IDE executes the rename action, saves all the files affected by the rename action, and closes the XML Refactoring window.

To safely delete an XML schema component:

  1. Open the XML schema file in the Schema view or the Design view of the XML schema editor.
  2. Navigate to and select the XML schema component to delete.
  3. Right-click and choose Refactor > Safely Delete from the pop-up menu.
    The Safe Delete dialog box opens and shows you the name of the XML schema component you selected for deletion.
  4. To preview all changes in the XML Refactoring window, select the Preview All Changes checkbox.
  5. Click Next.
    The IDE finds usages of the XML schema component. If usages are found, a Safe Delete warning dialog box opens. This warning dialog box may also contain errors.
  6. (Optional) In the Safe Delete warning dialog box, click Find Usages to show the XML Usages window which contains usage information for the selected component.
    You can return to the refactoring action by clicking the Rerun Delete component-name button.
  7. In the Safe Delete warning dialog box, click Next.
  8. In the XML Refactoring window, review the refactoring changes.
  9. Clear the checkbox of any node where you do not want to apply the change.
  10. Click Do Refactoring to apply the selected changes.
    The IDE deletes the XML schema component and all references to the component, saves all the files affected by the refactoring action, and closes the XML Refactoring window.

To undo refactoring changes:

  1. After completing a Refactor > action command, select any XML schema component node in the Schema view or the Design view of the XML schema editor.
  2. Right-click and choose Refactor > Undo [action] from the pop-up menu.
    The IDE rolls back all the changes in all the files that were affected by the refactoring.

To redo undone refactoring changes:

  1. After completing a Refactor > Undo [action] command, select any XML schema component node in the Schema view or the Design view of the XML schema editor.
  2. Right-click and choose Refactor > Redo [action] from the pop-up menu.
    The IDE reverses the changes from the last Refactor > Undo [action] command.
See Also
XML Refactoring Window (XML Schema Tools)
About XML Schema Tools

Legal Notices