OpenXLIFF Filters

OpenXLIFF Filters logo

A set of Java filters for creating, merging and validating XLIFF 1.2 and 2.x files.

The source code of OpenXLIFF Filters is available on GitHub. Anyone can download, compile, modify and use the source code free of charge under the terms of the corresponding licenses.

Why OpenXLIFF?

OpenXLIFF Filters provides a practical way to work with XLIFF 1.2 and 2.x in Java. It focuses on clear behavior, predictable results, and support for a wide range of document formats.

Intended Audience

OpenXLIFF is intended for Java developers and localization teams who need reliable XLIFF 1.2 and 2.x processing.

The points below summarize the main characteristics of the library.

  • Built with current tools
    The library uses JDK 21 and Gradle 9. The codebase is simple to build and maintain, without legacy components.

  • Standards‑oriented
    OpenXLIFF generates XLIFF files that follow the official specifications and avoids vendor‑specific extensions.

  • Full XLIFF 1.2 and 2.x support
    The library validates and processes XLIFF 1.2, 2.0, 2.1, and 2.2. It includes checks that go beyond XML Schema, such as detecting duplicate IDs and invalid language codes.

  • Broad format coverage
    OpenXLIFF handles many document types: Office formats, XML vocabularies, software resource files, subtitle formats, and others. This allows teams to use a single toolset for different kinds of content.

  • Consistent round‑trip behavior
    Conversion and merge operations are designed to preserve structure and content. You can generate XLIFF, translate it, and merge it back with consistent results, either through Java code or the command‑line tools.

  • Additional processing tools
    Includes utilities for pseudo‑translation, ICE match recovery, statistics, segment approval, cleanup, TMX export, and batch operations.

  • Straightforward integration
    The API is direct and easy to call from Java applications. There is no framework to learn and no extra configuration.

  • Part of the Maxprograms toolset
    OpenXLIFF works well with XLIFF Manager, Swordfish, and the XLIFF Validation Service, covering the full workflow from document preparation to translation and QA.

Features

With OpenXLIFF Filters you can:

  • Create XLIFF files that don't use proprietary markup.
  • Merge translated XLIFF files to generate translated documents.
  • Validate XLIFF files.
  • Recover ICE (In-Context Exact) matches from a previously translated XLIFF.
  • Generate statistics with word and segment counts, including a graphical display of match distribution.
  • Combine multiple XLIFF files into a larger one.
  • Pseudo-translate XLIFF files to test conversion/merge processing.
  • Copy the content of <source> elements to new <target> elements for all untranslated segments.
  • Approve all segments that contain translations.
  • Remove all <target> elements from an XLIFF file.
  • Export approved segments as TMX.

XLIFF Manager provides a graphical interface for creating and merging XLIFF files.

Supported File Formats

General Documentation

  • Adobe InDesign Interchange (INX)
  • Adobe InCopy and InDesign IDML (CS4 and newer)
  • HTML
  • Microsoft Office (2007 and newer)
  • Microsoft Visio XML Drawings (2007 and newer)
  • MIF (Maker Interchange Format)
  • OpenOffice, LibreOffice, StarOffice
  • Plain Text
  • QTI (IMS Question and Test Interoperability)
  • QTI Packages
  • SDLXLIFF (Trados Studio)
  • SRT Subtitles
  • Trados Studio Packages
  • GlobalLink / WordfastPRO TXML (*.txml)
  • GlobalLink / WordfastPRO XLIFF (*.txlf)
  • WPML XLIFF (WordPress Multilingual Plugin)
  • XLIFF from other tools (e.g., memoQ *.mqxliff, generic *.xliff)

XML Formats

  • XML (Generic)
  • DITA 1.0, 1.1, 1.2 and 1.3
  • DocBook 3.x, 4.x and 5.x
  • SVG
  • Word 2003 ML
  • XHTML

Software Development

  • JavaScript
  • Java Properties
  • JSON
  • PHP Arrays
  • PO (Portable Objects)
  • RC (Windows C/C++ Resources)
  • ResX (Windows .NET Resources)
  • TS (Qt Linguist translation source)

Requirements

  • JDK 21 or newer is required for compiling OpenXLIFF Filters.
  • Apache Gradle 9.0 or newer is required for building.

Building

OpenXLIFF Filters requires a modern Java toolchain for building and development.

  1. Check out the OpenXLIFF Filters repository from GitHub.
  2. Point your JAVA_HOME variable to JDK 21.
  3. Execute gradle.
git clone https://github.com/rmraya/OpenXLIFF.git 
cd OpenXLIFF
gradle

A binary distribution will be created in the /dist folder.

Convert Documents to XLIFF

You can use the library in your own Java code. Conversion to XLIFF is handled by the class com.maxprograms.converters.Convert.

If you use binaries from the command line, running .\convert.cmd or ./convert.sh without parameters displays help for XLIFF generation.

Convert XLIFF to Original Format

You can convert XLIFF files created with OpenXLIFF Filters to original format using the class com.maxprograms.converters.Merge in your Java code.

If you use binaries from the command line, running .\merge.cmd or ./merge.sh without parameters will display the information you need to merge an XLIFF file.

Validating XLIFF Files

The original XLIFFChecker supported XLIFF 1.0, 1.1, and 1.2. The version included in OpenXLIFF Filters also supports XLIFF 2.0, 2.1, and 2.2.

All XLIFF 2.0 modules are validated using XML Schema validation.

Standard XML Schema validation does not detect the use of duplicated 'id' attributes, wrong language codes and other constraints written in the different XLIFF specifications.

Extra validation is performed for XLIFF 2.0 Core and for Metadata, Matches and Glossary modules.

You can use the library in your own Java code. Validation of XLIFF files is handled by the class com.maxprograms.validation.XLIFFChecker.

Translation Status Analysis

The library can generate an HTML report with word counts and segment‑status statistics.

If you use binaries from the command line, running .\analysis.cmd or ./analysis.sh without parameters displays help for statistics generation.

You can generate statistics using your own Java code. Statistics generation is handled by the class com.maxprograms.stats.RepetitionAnalysis.