# Annotation Viewer

The Annotation Viewer is a tool for viewing analysis results that have been saved to your disk as external XML representations of the CAS. These are saved in a particular format called XMI. In the UIMA SDK, XML versions of CASes can be generated by:

- Running the Document Analyzer (see , which saves an XML representations of the CAS to the specified output directory.

- Running a Collection Processing Engine that includes the XMI Writer CAS Consumer (`examples/descriptors/cas_consumer/XmiWriterCasConsumer.xml)`.

- Explicitly creating XML representations of the CAS from your own application using the org.apache.uima.cas.impl.XMISerializer class. The best way to learn how to do this is to look at the example code for the XMI Writer CAS Consumer, located in `examples/src/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java`.

  An older form of a different XML format for the CAS is also provided mainly for backwards compatibility. This form is called XCAS, and you can see examples of its use in `examples/src/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java`.

The Annotation Viewer only shows CAS views where the Sofa data type is a String.

You can run the Annotation Viewer by executing the `annotationViewer` shell script located in the bin directory of the UIMA SDK or the "UIMA Annotation Viewer" Eclipse run configuration in the `uimaj-examples` project. This will open the following window:

Screenshot of annotationViewer

Select an input directory (which must contain XMI files), and the descriptor for the AE that produced the Analysis (which is needed to get the type system for the analysis). Then press the View button.

This will bring up a dialog where you can select a viewing format and double-click on a document to view it. This dialog is the same as the one that is described in .