Text and XML Triggers tutorial
Making a freetext trigger Freetext triggers example

## Example

This example adds an XML content trigger to the data of XS-S-1. The main features of this example are:

- Display a list of documents held in a table.
- Add a new document or delete an existing one.
- Define a trigger.
- Show the hits found by the triggers.

## Document upload and list page

- The URI for the document is entered, and the system goes to retrieve it using xml_uri_get().
- The document is inserted into a table.
- If the document is HTML it is converted to XHTML with xml_tree() HTML mode.
- If the HTML is not in a valid format or the document at the URI is not found, an error is reported.
- There is a list of the rows in the documents table.
- Each row has a delete button, to remove the document.

## Trigger definition page

- The triggers page allows triggers to be added and deleted. When a trigger is deleted the hits are also deleted.
- Some pre-existing triggers look for text of specific tags in the XS-S-1 material.

## Hits page

- The hits are listed on this page.
- The hits page has a delete all button, to remove the hits.