# Okapi Framework - Filters ## XML Stream 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=XML_Stream_Filter

## Overview

This filter allows you to process XML documents.

It uses an XML stream parser, which allows to process much larger documents than a DOM-based parser.

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

Remember that XML documents without an XML declaration may be read incorrectly if the encoding of the document is not UTF-8, UTF-16 or UTF-32.

## Processing Details

### Input Encoding

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

- If the document has an encoding declaration it is used.
- Otherwise, UTF-8 is used as the default encoding (regardless the actual default encoding that was specified when opening the document).

### 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.

If the original document had an XML encoding declaration it is updated, if it did not, one is automatically added.

### Line-Breaks

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

## Parameters

Under Construction