# Okapi Framework - Filters ## DTD Filter (BETA)
- Overview - Processing Details - Parameters |
Filters | Developer's Guide | Okapi Framework

If you are using an Okapi Tool after the M9 release, you should be using the wiki online help:
http://www.opentag.com/okapi/wiki/index.php?title=DTD_Filter

## Overview

This filter allows you to process DTD (Document Type Definition) documents.

The filter is intended to process XML-DTD that have translatable text entity declarations, as shown below. An example of such DTDs are the Mozilla DTD files that go with the XUL documents used to build the user-interface parts.

Example of DTD with text entity declarations:

    <!--Comments-->
    <!ENTITY findWindow.title "Find Files">
    <!ENTITY fileMenu.label "File">
    <!ENTITY editMenu.label "Edit">

This filter is implemented in the class `net.sf.okapi.filters.dtd.DTDFilter` of the Okapi library.

## Processing Details

### Input Encoding

The filter decides which encoding to use for the input file using the following logic:

- If the file has a Unicode Byte-Order-Mark:
  - Then, the corresponding encoding (e.g. UTF-8, UTF-16, etc.) is used.
- Otherwise, the input encoding used is the default encoding that was specified when setting the filter options.

### Output Encoding

If the output encoding is UTF-8:

- If the input encoding was also UTF-8, a Byte-Order-Mark is used for the output document only if one was detected in the input document.
- If the input encoding was not UTF-8, no Byte-Order-Mark is used in the output document.

### Line-Breaks

The type of line-breaks of the output is the same as the one of the original input.

## Parameters

TODO