10. The "Search Files" tool
Prev | Chapter 7. Tools | Next

## 10. The "Search Files" tool

This tool is displayed after you click the Search button in the "Browse Files" tool. The "Browse Files" tool is itself displayed after you select any of the menu items of the File → Folder submenu.

You may need to enable the File → Folder submenu by checking "Enable the 'File|Folder' Submenu" in Options → Preferences, General|Features section.

Figure 7.6. Search our DITA tutorial for topic files (`*.dita`) containing substring "`link`"

### Toolbar buttons

Clear

  Clear the query text field (see below), the "File name:" text field and the "search results" pane.

Create or edit an advanced query

  Display a query editor dialog box allowing to create an advanced query or to edit the current query (that is, the one specified in the query text field).

Help

  Displays an online help for "Search Files" tool.

Search next

  Displays up to 20 more results for the current search.

Search

  Start searching or restart current search . Display at most the first 20 results.

  When a search is being performed, the Search and Search next buttons are given a special Stop icon . Clicking this icon allows to stop the search.

### The query text field

Below the toolbar is found a text field where you can type a query. It's possible to type simple or advanced queries in this text field.

Advanced queries are documented in Section 10.1, “The "Create or edit an advanced query" dialog box”.

A simple query such as "`Hello world!`" (without the quotes) means: find all XML files containing an element whose direct textual content contains substring "`hello world!`" (case-insensitive).

This is very different from web search engines such as Google™ where query "`Hello world!`" (without the quotes) means: find all pages containing word "`hello`" and word "`world`" (case-insensitive).

Note that this simple text search facility is always case-insensitive. Also note that the whitespace in the textual content of elements, attributes, comments and processing-instruction is always normalized while traversing the content of an XML file. That is, the possible indentation of the XML file will not affect the results of the search.

The query text field may be left empty, in which case the search will be performed on the basenames of the files. See below.

### The "search files by name" form

The "Search subfolders" checkbox allows to perform the search, not only in the current folder, but also recursively in all its subfolders.

Below the "Search subfolders" checkbox is found a "File name:" text field where you can type a glob pattern. This glob pattern is used to match the basename of the files being searched.

When this field is left empty, XXE will search all the files known to be XML (the union of `*.xml`, `*.dita`, `*.ditamap`, `*.dbk`, `*.xsl`, `*.xsd`, `*.fo`, etc).

### Tip

Note that, by default, `.htm`, `.html` and `.shtml` files are not considered to be XML files. Only `.xhtml` files are considered to be XML files. Therefore, if you always create XHTML files and nevertheless give your files extensions such as `.htm`, `.html` or `.shtml`, do not forget to specify "`*.*htm*`" in the "File name:" text field.

Note that the query text field may be left empty, in which case the search will be performed on the basenames of the files. For example, specify "`*.{svg,png}`" in the "File name:" field and leave blank the query field in order to list all `SVG` and all `PNG` files.

### The "search results" pane

Below the above toolbar and text fields, is found an interactive pane containing the results of a search:

- Press Up to select the preceding result. Press Down to select the following result.

- Press Enter to open in XXE the document corresponding to selected result.

- Click on a result to select it.

- Double-click on result to open in XXE the document corresponding to this result.

- Right-click on a result to first select it and then to display the following popup menu:

  | Open Open in XXE the document corresponding to selected result. Open Document in Read-only Mode Same as above, but the document is opened in read-only mode. Open Containing Folder Open the folder containing the document corresponding to selected result. This menu item displays the "Browse Files" tool.

- Dragging the selected result will drag the corresponding document inside or outside XXE.

  Note that when a document is dragged and dropped onto XXE, this document is always opened or reopened in XXE. This is not the case of all the "open document" facilities described above. Such facilities have been designed for navigation and thus, will not reopen a document if it's already opened in XXE. Instead, the opened document will automatically scroll to display the element of interest.

Prev | Up | Next
9. The "Browse Files" tool | Home | 10.1. The "Create or edit an advanced query" dialog box