8. 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 FileFolder submenu.

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

Figure 7.5. Search our DITA tutorial for topic files (*.dita) containing substring "link"
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 8.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: