Fixed a bug in loadresources.xml generation.

Enhanced custom command handling for desktop tools integration.
This commit is contained in:
Zukero
2018-02-05 18:15:18 +01:00
parent c3144db751
commit 9e6e1d936d
3 changed files with 48 additions and 7 deletions

View File

@@ -1232,18 +1232,17 @@ public class Project implements ProjectTreeNode, Serializable {
String jsonResPrefix = "@raw/";
String tmxResPrefix = "@xml/";
String jsonFileSuffix = ".json";
String tmxFileSuffix = ".xml";
String tmxFileSuffix = ".tmx";
if (!xmlFile.exists()) return;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
Document doc;
try {
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setExpandEntityReferences(false);
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource insrc = new InputSource(new FileInputStream(xmlFile));
// insrc.setSystemId("http://worldmap/");
insrc.setEncoding("UTF-8");
doc = builder.parse(insrc);
@@ -1296,8 +1295,9 @@ public class Project implements ProjectTreeNode, Serializable {
Result output = new StreamResult(new FileOutputStream(outputFile));
Source input = new DOMSource(doc);
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "2");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
transformer.transform(input, output);
} catch (SAXException e) {
e.printStackTrace();