Skip to content

Commit

Permalink
Merge pull request #29 from rmraya/Java21
Browse files Browse the repository at this point in the history
Migrated to Java21
  • Loading branch information
rmraya authored Jan 6, 2024
2 parents 0a09782 + 6077855 commit 532c532
Show file tree
Hide file tree
Showing 44 changed files with 3,657 additions and 198 deletions.
5 changes: 0 additions & 5 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/mapdb.jar">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/xmljava.jar">
<attributes>
<attribute name="module" value="true"/>
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ An open source set of Java filters for creating, merging and validating XLIFF 1.

With OpenXLIFF Filters you can create XLIFF files that don't use proprietary markup and are compatible with most CAT (Computer Asisted Translation) tools.

**XLIFFChecker**, an open source XLIFF validation tool, is now part of OpenXLIFF Filters. Its code has been ported to Java 11 and enhanced with support for XLIFF 2.0.

- **[Releases](https://github.com/rmraya/OpenXLIFF#releases)**
- **[Binary Downloads](https://www.maxprograms.com/products/openxliff.html)**
- **[Filters Configuration](https://github.com/rmraya/OpenXLIFF#filters-configuration)**
Expand Down Expand Up @@ -49,6 +47,7 @@ XML and JSON filters are configurable

Version | Comment | Release Date
:------:|---------|:-----------:
3.17.0 | Improved extraction from Word text boxes; switched to Java 21 | January 6th, 2024
3.16.0 | Added catalog for XLIFF 2.2; adjusted ChatGPT models | October 29th, 2023
3.15.0 | Added new options to JSON filter configuration | September 13th, 2023
3.14.0 | Added option to generate XLIFF 2.1 | September 1st, 2023
Expand Down Expand Up @@ -170,13 +169,13 @@ OpenXLIFF Filters can generate XLIFF 1.2 and XLIFF 2.0 from these formats:

## Requirements

- JDK 17 or newer is required for compiling and building. Pre-built binaries already include everything you need to run all options.
- Apache Ant 1.10.12 or newer
- JDK 21 or newer is required for compiling and building. Pre-built binaries already include everything you need to run all options.
- Apache Ant 1.10.13 or newer

## Building

- Checkout this repository.
- Point your JAVA_HOME variable to JDK 17
- Point your JAVA_HOME variable to JDK 21
- Run `ant` to generate a binary distribution in `./dist`

### Steps for building
Expand Down
5 changes: 2 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="dist" name="OpenXLIFF">
<property name="target" value="17" />
<property name="source" value="17" />
<property name="target" value="21" />
<property name="source" value="21" />
<property name="build.compiler" value="javac10+" />
<path id="OpenXLIFF.classpath">
<pathelement location="lib/dtd.jar" />
<pathelement location="lib/json.jar" />
<pathelement location="lib/jsoup.jar" />
<pathelement location="lib/mapdb.jar" />
<pathelement location="lib/xmljava.jar" />
</path>
<condition property="isWindows">
Expand Down
70 changes: 68 additions & 2 deletions catalog/catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,77 @@
<system systemId="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod" uri="xhtml1.1/xhtml11-model-1.mod" />
<uri name="http://www.w3.org/1999/xhtml" uri="xhtml1.1/xhtml11-flat.dtd" />
<system systemId="xhtml11.dtd" uri="xhtml1.1/xhtml11-flat.dtd" />
<public publicId="-//W3C//ENTITIES XHTML Modular Framework 1.0//EN" uri="xhtml1.1/xhtml-framework-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod" uri="xhtml1.1/xhtml-framework-1.mod" />
<public publicId="-//W3C//ENTITIES XHTML Datatypes 1.0//EN" uri="xhtml1.1/xhtml-datatypes-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod" uri="xhtml1.1/xhtml-datatypes-1.mod" />
<public publicId="-//W3C//ENTITIES XHTML Qualified Names 1.0//EN" uri="xhtml1.1/xhtml-qname-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod" uri="xhtml1.1/xhtml-qname-1.mod" />
<public publicId="-//W3C//ENTITIES XHTML Common Attributes 1.0//EN" uri="xhtml1.1/xhtml-attribs-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod" uri="xhtml1.1/xhtml-attribs-1.mod" />
<public publicId="-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN" uri="xhtml1.1/xhtml-events-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod" uri="xhtml1.1/xhtml-events-1.mod" />
<public publicId="-//W3C//ENTITIES XHTML Character Entities 1.0//EN" uri="xhtml1.1/xhtml-charent-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-charent-1.mod" uri="xhtml1.1/xhtml-charent-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Text 1.0//EN" uri="xhtml1.1/xhtml-text-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod" uri="xhtml1.1/xhtml-text-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN" uri="xhtml1.1/xhtml-inlstruct-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod" uri="xhtml1.1/xhtml-inlstruct-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN" uri="xhtml1.1/xhtml-inlphras-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod" uri="xhtml1.1/xhtml-inlphras-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Block Structural 1.0//EN" uri="xhtml1.1/xhtml-blkstruct-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod" uri="xhtml1.1/xhtml-blkstruct-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN" uri="xhtml1.1/xhtml-blkphras-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod" uri="xhtml1.1/xhtml-blkphras-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Hypertext 1.0//EN" uri="xhtml1.1/xhtml-hypertext-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod" uri="xhtml1.1/xhtml-hypertext-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Lists 1.0//EN" uri="xhtml1.1/xhtml-list-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod" uri="xhtml1.1/xhtml-list-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Editing Markup 1.0//EN" uri="xhtml1.1/xhtml-edit-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod" uri="xhtml1.1/xhtml-edit-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML BDO Element 1.0//EN" uri="xhtml1.1/xhtml-bdo-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod" uri="xhtml1.1/xhtml-bdo-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Ruby 1.0//EN" uri="xhtml1.1/xhtml-ruby-1.mod" />
<uri name="http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" uri="xhtml1.1/xhtml-ruby-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Presentation 1.0//EN" uri="xhtml1.1/xhtml-pres-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod" uri="xhtml1.1/xhtml-pres-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN" uri="xhtml1.1/xhtml-inlpres-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-inlpres-1.mod" uri="xhtml1.1/xhtml-inlpres-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN" uri="xhtml1.1/xhtml-blkpres-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-blkpres-1.mod" uri="xhtml1.1/xhtml-blkpres-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Link Element 1.0//EN" uri="xhtml1.1/xhtml-link-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod" uri="xhtml1.1/xhtml-link-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Metainformation 1.0//EN" uri="xhtml1.1/xhtml-meta-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod" uri="xhtml1.1/xhtml-meta-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Base Element 1.0//EN" uri="xhtml1.1/xhtml-base-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod" uri="xhtml1.1/xhtml-base-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Scripting 1.0//EN" uri="xhtml1.1/xhtml-script-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod" uri="xhtml1.1/xhtml-script-1.mod" />
<public publicId="-//W3C//DTD XHTML Style Sheets 1.0//EN" uri="xhtml1.1/xhtml-style-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod" uri="xhtml1.1/xhtml-style-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Images 1.0//EN" uri="xhtml1.1/xhtml-image-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod" uri="xhtml1.1/xhtml-image-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN" uri="xhtml1.1//xhtml-csismap-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod" uri="xhtml1.1//xhtml-csismap-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN" uri="xhtml1.1/xhtml-ssismap-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod" uri="xhtml1.1/xhtml-ssismap-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Param Element 1.0//EN" uri="xhtml1.1/xhtml-param-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod" uri="xhtml1.1/xhtml-param-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN" uri="xhtml1.1/xhtml-object-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod" uri="xhtml1.1/xhtml-object-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Tables 1.0//EN" uri="xhtml1.1/xhtml-table-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod" uri="xhtml1.1/xhtml-table-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Forms 1.0//EN" uri="xhtml1.1/xhtml-form-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod" uri="xhtml1.1/xhtml-form-1.mod" />
<public publicId="-//W3C//ELEMENTS XHTML Document Structure 1.0//EN" uri="xhtml1.1/xhtml-struct-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod" uri="xhtml1.1/xhtml-struct-1.mod" />
<public publicId="-//W3C//NOTATIONS XHTML Notations 1.0//EN" uri="xhtml1.1/xhtml-notations-1.mod" />
<uri name="http://www.w3.org/MarkUp/DTD/xhtml-notations-1.mod" uri="xhtml1.1/xhtml-notations-1.mod" />

<public publicId="-//W3C//DTD SVG 1.0//EN" uri="svg/svg10.dtd" />
<system systemId="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" uri="svg/svg10.dtd" />
<uri name="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" uri="svg/svg10.dtd" />
<public publicId="-//W3C//DTD SVG 1.1//EN" uri="svg/svg11.dtd" />
<system systemId="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" uri="svg/svg11.dtd" />
<uri name="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" uri="svg/svg11.dtd" />

<public publicId="-//OpenOffice.org//DTD OfficeDocument 1.0//EN" uri="openoffice/office.dtd" />
<system systemId="office.dtd" uri="openoffice/office.dtd" />
Expand Down
142 changes: 142 additions & 0 deletions catalog/xhtml1.1/xhtml-attribs-1.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<!-- ...................................................................... -->
<!-- XHTML Common Attributes Module ...................................... -->
<!-- file: xhtml-attribs-1.mod
This is XHTML, a reformulation of HTML as a modular XML application.
Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
Revision: $Id: xhtml-attribs-1.mod,v 1.1 2018/03/20 04:25:01 plehegar Exp $ SMI
This DTD module is identified by the PUBLIC and SYSTEM identifiers:
PUBLIC "-//W3C//ENTITIES XHTML Common Attributes 1.0//EN"
SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod"
Revisions:
(none)
....................................................................... -->

<!-- Common Attributes
This module declares many of the common attributes for the XHTML DTD.
%NS.decl.attrib; is declared in the XHTML Qname module.
Note that this file was extended in XHTML Modularization 1.1 to
include declarations of "global" versions of the attribute collections.
The global versions of the attributes are for use on elements in other
namespaces. The global version of "common" includes the xmlns declaration
for the prefixed version of the xhtml namespace. If you are only using a
specific attribute or an individual attribute collection, you must also
include the XHTML.xmlns.attrib.prefixed PE on your elements.
-->

<!ENTITY % id.attrib
"id ID #IMPLIED"
>

<![%XHTML.global.attrs.prefixed;[
<!ENTITY % XHTML.global.id.attrib
"%XHTML.prefix;:id ID #IMPLIED"
>
]]>

<!ENTITY % class.attrib
"class CDATA #IMPLIED"
>

<![%XHTML.global.attrs.prefixed;[
<!ENTITY % XHTML.global.class.attrib
"%XHTML.prefix;:class CDATA #IMPLIED"
>
]]>

<!ENTITY % title.attrib
"title %Text.datatype; #IMPLIED"
>

<![%XHTML.global.attrs.prefixed;[
<!ENTITY % XHTML.global.title.attrib
"%XHTML.prefix;:title %Text.datatype; #IMPLIED"
>
]]>

<!ENTITY % Core.extra.attrib "" >

<!ENTITY % Core.attrib
"%XHTML.xmlns.attrib;
%id.attrib;
%class.attrib;
%title.attrib;
xml:space ( preserve ) #FIXED 'preserve'
%Core.extra.attrib;"
>

<!ENTITY % XHTML.global.core.extra.attrib "" >

<![%XHTML.global.attrs.prefixed;[

<!ENTITY % XHTML.global.core.attrib
"%XHTML.global.id.attrib;
%XHTML.global.class.attrib;
%XHTML.global.title.attrib;
%XHTML.global.core.extra.attrib;"
>
]]>

<!ENTITY % XHTML.global.core.attrib "" >


<!ENTITY % lang.attrib
"xml:lang %LanguageCode.datatype; #IMPLIED"
>

<![%XHTML.bidi;[
<!ENTITY % dir.attrib
"dir ( ltr | rtl ) #IMPLIED"
>

<!ENTITY % I18n.attrib
"%dir.attrib;
%lang.attrib;"
>

<![%XHTML.global.attrs.prefixed;[
<!ENTITY XHTML.global.i18n.attrib
"%XHTML.prefix;:dir ( ltr | rtl ) #IMPLIED
%lang.attrib;"
>
]]>
<!ENTITY XHTML.global.i18n.attrib "" >

]]>
<!ENTITY % I18n.attrib
"%lang.attrib;"
>
<!ENTITY % XHTML.global.i18n.attrib
"%lang.attrib;"
>

<!ENTITY % Common.extra.attrib "" >
<!ENTITY % XHTML.global.common.extra.attrib "" >

<!-- intrinsic event attributes declared previously
-->
<!ENTITY % Events.attrib "" >

<!ENTITY % XHTML.global.events.attrib "" >

<!ENTITY % Common.attrib
"%Core.attrib;
%I18n.attrib;
%Events.attrib;
%Common.extra.attrib;"
>

<!ENTITY % XHTML.global.common.attrib
"%XHTML.xmlns.attrib.prefixed;
%XHTML.global.core.attrib;
%XHTML.global.i18n.attrib;
%XHTML.global.events.attrib;
%XHTML.global.common.extra.attrib;"
>

<!-- end of xhtml-attribs-1.mod -->
53 changes: 53 additions & 0 deletions catalog/xhtml1.1/xhtml-base-1.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!-- ...................................................................... -->
<!-- XHTML Base Element Module ........................................... -->
<!-- file: xhtml-base-1.mod
This is XHTML, a reformulation of HTML as a modular XML application.
Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
Revision: $Id: xhtml-base-1.mod,v 1.1 2018/03/20 04:25:01 plehegar Exp $ SMI
This DTD module is identified by the PUBLIC and SYSTEM identifiers:
PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod"
Revisions:
(none)
....................................................................... -->

<!-- Base element
base
This module declares the base element type and its attributes,
used to define a base URI against which relative URIs in the
document will be resolved.
Note that this module also redeclares the content model for
the head element to include the base element.
-->

<!-- base: Document Base URI ........................... -->

<!ENTITY % base.element "INCLUDE" >
<![%base.element;[
<!ENTITY % base.content "EMPTY" >
<!ENTITY % base.qname "base" >
<!ELEMENT %base.qname; %base.content; >
<!-- end of base.element -->]]>

<!ENTITY % base.attlist "INCLUDE" >
<![%base.attlist;[
<!ATTLIST %base.qname;
%XHTML.xmlns.attrib;
href %URI.datatype; #REQUIRED
>
<!-- end of base.attlist -->]]>

<!ENTITY % head.content
"( %HeadOpts.mix;,
( ( %title.qname;, %HeadOpts.mix;, ( %base.qname;, %HeadOpts.mix; )? )
| ( %base.qname;, %HeadOpts.mix;, ( %title.qname;, %HeadOpts.mix; ))))"
>

<!-- end of xhtml-base-1.mod -->
47 changes: 47 additions & 0 deletions catalog/xhtml1.1/xhtml-bdo-1.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- ...................................................................... -->
<!-- XHTML BDO Element Module ............................................. -->
<!-- file: xhtml-bdo-1.mod
This is XHTML, a reformulation of HTML as a modular XML application.
Copyright 1998-2005 W3C (MIT, ERCIM, Keio), All Rights Reserved.
Revision: $Id: xhtml-bdo-1.mod,v 1.1 2018/03/20 04:25:01 plehegar Exp $ SMI
This DTD module is identified by the PUBLIC and SYSTEM identifiers:
PUBLIC "-//W3C//ELEMENTS XHTML BDO Element 1.0//EN"
SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod"
Revisions:
(none)
....................................................................... -->

<!-- Bidirectional Override (bdo) Element
This modules declares the element 'bdo', used to override the
Unicode bidirectional algorithm for selected fragments of text.
DEPENDENCIES:
Relies on the conditional section keyword %XHTML.bidi; declared
as "INCLUDE". Bidirectional text support includes both the bdo
element and the 'dir' attribute.
-->

<!ENTITY % bdo.element "INCLUDE" >
<![%bdo.element;[
<!ENTITY % bdo.content
"( #PCDATA | %Inline.mix; )*"
>
<!ENTITY % bdo.qname "bdo" >
<!ELEMENT %bdo.qname; %bdo.content; >
<!-- end of bdo.element -->]]>

<!ENTITY % bdo.attlist "INCLUDE" >
<![%bdo.attlist;[
<!ATTLIST %bdo.qname;
%Core.attrib;
%lang.attrib;
dir ( ltr | rtl ) #REQUIRED
>
]]>

<!-- end of xhtml-bdo-1.mod -->
Loading

0 comments on commit 532c532

Please sign in to comment.