Table of Contents
User Guide
Source Editor
Source Editor Overview
Use the Source Editor to view and edit a topic's underlying XML.
Editing the DITA Markup
Use the Topic Editor to edit a topic's source code.
Searching in the Source Editor
Use the find feature in the Source Editor to search for content.
Source Editor Overview

Use the Source Editor to view and edit a topic’s underlying XML.
section
You can view, edit, and search a topic’s underlying XML using the Source Editor. The Source Editor uses syntax coloring to help you identify elements, attributes, values, and invalid XML. Existing XML will already conform to the syntax coloring, while new text is configured as you type.
With a topic open, you can access the Source Editor from any topic by doing any of the following:
  • Click Edit -> Source Code

  • Press Ctrl+Shift+”,” (Windows)

  • Press Cmd+Shift+”,” (Mac)

The Source Editor makes switching between editing in the Topic Editor and editing in the Source Editor seamless. If you have text selected in the topic before opening the Source Editor, the text will still be selected in the Source Editor. So you can quickly begin editing the XML from where you left off in the Topic Editor .  
You can also use Ctrl+F (Windows) or Cmd+F (Mac) to search for text in the Source Editor. You can enter a search term or use regular expression to search for text.
Any saved changes made in the Source Editor are applied to the topic. If the changes you made result in invalid XML, the invalid areas will display in red and the Source Editor will not close and save.
Editing the DITA Markup

Use the Topic Editor to edit a topic’s source code.
  1. In the Content Manager , open a topic and click Edit -> Source Code .

    Step Information

    Expected Result
    The Edit Source window displays the DITA markup for the topic.

  2. Modify the XML.
  3. Click Save .

    Step Information
    Attention:If you enter invalid XML, the XML Source Editor will not allow you to save and close. If you click the Save button and the Source Editor doesn’t close, then the DITA you have entered is not valid, and you should double check your code.

    Edit Source window

result

You’re viewing and editing the topic’s source code.

Searching in the Source Editor

Use the find feature in the Source Editor to search for content.
  1. In the Content Manager , open a topic and click Edit -> Source Code .

    Step Information

    Expected Result
    The Edit Source window displays the DITA markup for the topic.

  2. Press Ctrl+F (Windows) or press Cmd+F (Mac).

    Expected Result
    The Source Editor’s search field displays.
  3. Type a search term and press Enter.

    Example
    Search for edit.
    Expected Result
    All matches are highlighted.
  4. To navigate the search results, do any of the following:

    1. To navigate to the next search result, press Ctrl+G (Windows) or Cmd+G (Mac).
    2. To navigate to the previous search result, press Shift+Ctrl+G (Windows) or Shift+Cmd+G (Mac).
  5. To replace only the selected search result, do the following:

    1. Press Shift+Ctrl+F (Windows) or Cmd+Option+F (Mac) and then press Enter.

      Step Information
      The Replace field displays the selected search result that you’ll replace.

      With field

    2. Enter the text you want to replace the selected search result with and then press Enter.
    3. Click Yes.

      Step Information
  6. To replace all matching search results, do the following:

    1. Press Shift+Ctrl+R (Windows) or Shift+Cmd+Option+F (Mac) and then press Enter.

      Step Information
      The Replace all field displays the search result that you’ll replace.
      Expected Result
      The With field displays.
    2. Enter the text you want to replace all search results with and then press Enter.
result

You’re using the Source Editor to search or replace text.