diff --git a/lib/openxliff.jar b/lib/openxliff.jar index 20954a4f..3a6dbe89 100644 Binary files a/lib/openxliff.jar and b/lib/openxliff.jar differ diff --git a/sonar-project.properties b/sonar-project.properties index 77dbfdd8..d7cad783 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.projectKey=OpenXLIFF # this is the name displayed in the SonarQube UI sonar.projectName=OpenXLIFF -sonar.projectVersion=3.22.0 +sonar.projectVersion=4.0.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Since SonarQube 4.2, this property is optional if sonar.modules is set. diff --git a/src/com/maxprograms/converters/Constants.java b/src/com/maxprograms/converters/Constants.java index 07ae9c77..dae49f97 100644 --- a/src/com/maxprograms/converters/Constants.java +++ b/src/com/maxprograms/converters/Constants.java @@ -22,7 +22,7 @@ private Constants() { public static final String TOOLID = "OpenXLIFF"; public static final String TOOLNAME = "OpenXLIFF Filters"; public static final String VERSION = "4.0.0"; - public static final String BUILD = "20241214_1706"; + public static final String BUILD = "20241214_1748"; public static final String SUCCESS = "0"; public static final String ERROR = "1"; diff --git a/src/com/maxprograms/converters/xml/Xliff2Xml.java b/src/com/maxprograms/converters/xml/Xliff2Xml.java index 08277183..4d7fe80c 100644 --- a/src/com/maxprograms/converters/xml/Xliff2Xml.java +++ b/src/com/maxprograms/converters/xml/Xliff2Xml.java @@ -281,6 +281,7 @@ private static void changeLanguage(String outputFile) throws SAXException, IOExc Document doc = builder.build(outputFile); Element root = doc.getRootElement(); root.setAttribute("xml:lang", tgtLang); + updatePI(root); Indenter.indent(root, 2); XMLOutputter outputter = new XMLOutputter(); outputter.preserveSpace(true); @@ -289,6 +290,19 @@ private static void changeLanguage(String outputFile) throws SAXException, IOExc } } + private static void updatePI(Element e) { + List pis = e.getPI(); + for (int i = 0; i < pis.size(); i++) { + PI pi = pis.get(i); + String data = pi.getData(); + pi.setData(data.replace("\n", "")); + } + List children = e.getChildren(); + for (Element child : children) { + updatePI(child); + } + } + private static void recurse(Element e) { List content = e.getContent(); for (int i = 0; i < content.size(); i++) {